• Resolved mathiasvissers

    (@mathiasvissers)


    Hi

    I’ve copied the template as described in the documentation to a custom directory:
    /www/wp-content/themes/yolo-begreen/woocommerce/pdf/yourtemplate/invoice.php

    Now I’ve added this line after <?php $this->billing_address(); ?>

    <?php $this->custom_field('billing_wcj_checkout_field_1'); ?> to display the Vat number.

    However, when I re-generate the PDF (via the orders screen in Woocommerce), the field isn’t displayed.
    When I just enter XXXXX in the template (no PHP tags), the changes aren’t displayed either.

    It will be definitely something stupid, but what I’m doing wrong? ??

    Thank you!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor Ewout

    (@pomegranate)

    Hi Mathias,
    Since you mention that the XXXX is not displayed either, it sounds like you may still be on the Simple template. You have to select the ‘yourtemplate’ in the General settings after creating that folder and copying the files.

    In addition, sometimes you need to prefix an underscore to the custom field if it’s a hidden field. More information on finding custom fields: https://docs.wpovernight.com/general/finding-woocommerce-custom-fields/

    Let me know if that helps!
    Ewout

    Thread Starter mathiasvissers

    (@mathiasvissers)

    Hi Ewout

    That did the trick to display the XXXXX. I hadn’t noticed that option.

    Together with the _ it was the solution.

    Thank you very much!

    Have a nice weekend.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Custom fields in custom template not displayed’ is closed to new replies.