• ionicboy

    (@ionicboy)


    Hi Ewout,
    the code you give me:
    add_action( ‘wpo_wcpdf_after_order_details’, ‘wpo_wcpdf_after_order_details’, 10, 1 );
    function wpo_wcpdf_after_order_details ( $template_type ) {
    if ($template_type != ‘packing-slip’) {
    ?>
    <span class=”n41″>N41: Non imp. art. 41 L. 427/93</span>
    <?php
    }
    }

    Is not functioning, the text n41 will appear always, indipendent of invoice with or without eu vat number.
    why? what’s wrong?

    https://www.ads-software.com/plugins/woocommerce-pdf-invoices-packing-slips/

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

    (@pomegranate)

    Hello Nicola,
    That filter only checks if the template is an invoice (or actually if it’s not a packing slip, allowing all other documents), not if the invoice has a VAT number.
    To check for the VAT Number (assuming you are using the WooCommerce EU VAT number plugin), you have to add more checks:

    add_action( 'wpo_wcpdf_after_order_details', 'wpo_wcpdf_after_order_details', 10, 1 );
    function wpo_wcpdf_after_order_details ( $template_type ) {
    	$valid_vat_number = get_post_meta($wpo_wcpdf->export->order->id,'Valid EU VAT Number',true);
    	if ($template_type != 'packing-slip' && $valid_vat_number == 'true') {
    		?>
    		<span class="n41">N41: Non imp. art. 41 L. 427/93</span>
    		<?php
    	}
    }

    Hope that helps!

    Thread Starter ionicboy

    (@ionicboy)

    mmmhhh thank you for your help but now the code n41 doesn’t appear.
    I use WooCommerce EU VAT number plugin, if it vaidate a vat it will remove taxes according to the european eu vat law, and i want to insert the code n41.
    How can i do?
    Thank you Ewout, thery much!

    Plugin Contributor Ewout

    (@pomegranate)

    Hello Nicola,
    I tried to send you an email about this issue but I’m not sure if you received it. If not, please send a message to me at [email protected]!

    Ewout

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘filter "n41" custom text eu vat number’ is closed to new replies.