Support » Plugin: Checkout Field Editor (Checkout Manager) for WooCommerce » Printing fields to delivery note

  • Resolved Mick

    (@haarbollen)


    Hi

    I have installed plugin called “WooCommerce Print Invoice & Delivery Note” from Tyche Softwares. This delivery note prints default shipping and billing fields but nothing else. Since I have made a complete change – partly because I don’t use prices and delivery at all (it runs on booking plugin for distributors) – and the only thing I see on delivery note for print, are the products.

    Now, I made a request at Tyche’s also – this is their answer:

    ——————————-
    Hi Mick,
    ​
    Regarding your query, all the fields from the “WooCommerce Checkout Field Editor” plugin will be printed on the delivery note only if the details of that plugin is fetched. So, once it is done, details can be added to our template in print-content.php file. This will display all the fields on the delivery note.
    ——————————-

    How do I ‘fetch’ details and were do I ‘put them’?

    Thanks SO much in advance – hope you can help

    Mick

Viewing 10 replies - 1 through 10 (of 10 total)
  • Mick

    (@haarbollen)

    Note add:
    I have heard from the lovely people at Tyche’s.

    Here is their latest answer – looks good, if you could help me with the ‘fetch’ of your plugin for printing whole delivery note.

    Would make me really happy

    Thanks – Mick

    ———- SECOND ANSWER ———–

    Hi Mick,

    Can you please ask WooCommerce Checkout Field Editor plugin developers to help you to fetch the details? After fetching the details, we will assist you how to add it to our template.

    ————————————-

    Plugin Author ThemeHigh

    (@themehigh)

    When you add a custom field in checkout page it gets created as Order Field (order meta data). And the fields are saved in the wp_postmeta table.

    Inorder to retrieve the custom field from the database you can use the below function.

    $order_meta = get_post_meta( $order_id, $field_name, true );

    We hope this will help.

    Thank you!

    Mick

    (@haarbollen)

    Hi again

    Thank you very much.

    Can I actually see this table (wp_postmeta) in order to be sure to ‘name’ them correct?
    And, do I have to make a line for each meta-data I want to retrieve ($field_name)?

    Best regards, Mick

    Mick

    (@haarbollen)

    And note:

    The lines, are they to be placed in functions.php or do I have to place them in the prin-content.php-file provide by other plugin-author?

    Sorry to bother, I’m not that great a coder in any way :o)

    Plugin Author ThemeHigh

    (@themehigh)

    Let me answer your questions one by one.

    >> Can I actually see this table (wp_postmeta) in order to be sure to β€˜name’ them correct?

    We are using the WordPress default database for saving data. You can check the WordPress database table.

    >> And, do I have to make a line for each meta-data I want to retrieve ($field_name)?

    Yes, for each field you need to make a line of this code. In the place of $field_name you need to use your field name and in $order_id, you need to use the order id.

    >> The lines, are they to be placed in functions.php or do I have to place them in the prin-content.php-file provide by other plugin-author?

    We hope the code must be placed on the “print-content.php” file. We recommend you to contact the Tyche Software support to add this code.

    Thank you!

    Mick

    (@haarbollen)

    Support at its largest, thank you very much indeed.
    I hope not, but I might have additional questions – however I’m trying to get as far as I can with what you write here.

    Thanks a lot and have a great day

    Mick – :o)

    Mick

    (@haarbollen)

    Hi again.

    I have found several lines in the database.
    I was so sure, it had to be something I could fix but I’m in doubt.
    Screendump below shows three of the lines created (as you mention above):
    Database table screendump
    – but i can’t figure out how you want me to add an id for the meta-data to show, since every line creates a unique id and I only want one line to show what to print.

    Uphill for me – :o)

    Plugin Author ThemeHigh

    (@themehigh)

    For metadata shown in the screenshot, each item is related to a different order. For retrieving the metadata you need to provide the Order id (Post id) and field name (meta key) in the code. This will give metadata for the corresponding order.

    Hope this help.

    Thank you!

    Mick

    (@haarbollen)

    Hi again ThemeHigh

    I posted your suggestions to Tyche Software, the plugin-author.
    I tried to put in what they ment was the code to use.
    I uploaded this screenshot of support and my code – which doesn’t seem to work unfortunately. Do you have any other suggestions?
    Uploaded screenshot

    Thank you for your time – really looking forward to your answer

    Mick, Denmark

    Plugin Author ThemeHigh

    (@themehigh)

    We have checked the screen-shot and could see that you didn’t print the value that you have retrieved from the database. So please add the “echo” statement before retrieving the value as shown below:

    echo get_post_meta( $post_id, 'billing_last_name_two', true );

    Further, please ensure that the variable $post_id is your order id.

    Hope this help πŸ™‚

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Printing fields to delivery note’ is closed to new replies.