• Resolved janice4summer

    (@janice4summer)


    Hi,

    I use the plugin “Custom WooCommerce Checkout Fields Editor”.
    This generates an ordinary “custom field”, which I use for visitors to enter their VAT number.

    This “custom field” does not show up on my custom pdf template, under the “billing address”, although I followed exactly your documentation about this.

    Can you please give any tips for this ?
    Do I need to use another “custom fields” plugin for this ?
    We have the free version, as this suits our needs now.

    Thanks

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

    (@pomegranate)

    Hello Janice,
    Can you share the code you used to include the field in your custom template as well as a screenshot (or more details) on the setup you have with the Checkout Fields editor for this field?

    Thread Starter janice4summer

    (@janice4summer)

    Already solved it: It seems like I had to use a HOOK.
    Directly adding it to the template file did not work.

    I also changed the sort of hook, so that it is injected in the right place on the invoice.

    /*** ADD VAT NR ****/
    add_action( 'wpo_wcpdf_after_billing_address', 'wpo_wcpdf_vat_nr', 10, 2 );
    function wpo_wcpdf_vat_nr ($template_type, $order) {
    
            $document = wcpdf_get_document( $template_type, $order );
            ?>      
             <?php
    		 echo "<br>";
    		 $document->custom_field('vat_nr','VAT NR:'); ?>
           
            <?php
        }
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘custom VAT field not shown on pdf’ is closed to new replies.