• Resolved Floketos

    (@belmux)


    Good morning,
    I’m trying to add the NIP to my invoices, but I don’t know how to do it.
    https://prnt.sc/2DDnDPihn0Eg

    I read this tutorial:
    https://www.ads-software.com/support/topic/custom-filed-added/

    I used this code, but it still doesn’t work:

    add_action( 'wpo_wcpdf_after_order_data', 'wpo_wcpdf_nip_number', 10, 2 );
    function wpo_wcpdf_nip_number ( $template_type, $order ) {
    	if ( $template_type == 'invoice' && !empty( $order->get_meta('_billing_nip_') ) ) {
    		?>
    		<tr class="nip-number">
    			<th><?php _e( 'Numer NIP:', 'woocommerce-pdf-invoices-packing-slips' ); ?></th>
    			<td><?php echo $order->get_meta('_billing_nip_'); ?></td>
    		</tr>
    		<?php 
    	}
    }

    Maybe I skipped a step? I am using the WooCommerce Checkout Field Editor plugin from Woocommerce to add the NIP field and it is called “billing_nip” – https://prnt.sc/nry1VYq1_td0

    • This topic was modified 2 years, 10 months ago by Floketos.
    • This topic was modified 2 years, 10 months ago by Floketos.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor Darren Peyou

    (@dpeyou)

    Hey @belmux,

    I wonder: Have you tried removing the trailing & leading underscores? Your meta key is billing_nip but your code snippet has _billing_nip_ in 2 areas. Maybe that’s why it isn’t appearing, assuming it was indeed filled in?

    Plugin Contributor Yordan Soares

    (@yordansoares)

    Hi @belmux,

    Since we haven’t heard back from you in the last two weeks, we’re assuming you solved this issue, so I’ll go ahead and mark this ticket as Resolved.

    Feel free to reply to this topic is you still need help with this, or open a new topic if you have any other questions!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Custom filed added (NIP)’ is closed to new replies.