• Resolved borjacachan

    (@borjacachan)


    Hello, thank you very much for your help. I am using the Checkout Field Editor for WooCommerce plugin
    and I have added an extra fields with the name billing_cif. The field picks it up perfectly. Now I am trying to show the collected data to show it in the invoices with the Invoices for WooCommerce plugin (Bas Elbers) but I can’t do it. In their FAQ they put this information:

    How to add custom fields / meta-data to the PDF invoice template?
    Use below code to display meta-data. Replace {META_KEY} with the actual key. If you use another plugin, just ask the key from the author of that plugin.

    <? php echo BEWPI () -> templater () -> get_meta ('{META_KEY}'); ?>
    Important: A custom template is required to add a custom field to the PDF invoice.

    I have tried to put it and it gives an error. I have replaced META_KEY with the name of the billing_cif field but it doesn’t work. Can you help me? I am not an expert user in programming.

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author ThemeHigh

    (@themehigh)

    When you create a custom field named billing_cif in the checkout field editor plugin, the plugin will save the submitted field value with the key name as billing_cif. So inorder to display billing_cif value in the invoice template, you need to add the below code.

    <?php echo BEWPI()->templater()->get_meta( 'billing_cif' ); ?>

    Hope this will help.

    Thank you!

    Thread Starter borjacachan

    (@borjacachan)

    Thank you very much for your answer.
    I have tried the code and it does not work.
    I get an error when trying to generate the PDF. I don’t know if the code is only usable with the pro plugin, I’m using the free plugin, but according to the indications it should work.

    Plugin Author ThemeHigh

    (@themehigh)

    All the fields created using our plugin are saved as Order Meta Data.

    You can retrieve the data from the database using the below function:

    get_post_meta($order_id, 'field_name', true);

    If you are still facing any issues, please raise a ticket through our website. We hope our technical team will be able to help.

    Thank you!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to add custom fields / meta-data in PDF invoice template?’ is closed to new replies.