Plugin Contributor
kluver
(@kluver)
Hi @bartskol,
The NIP number you are seeing on your invoice right now is not coming from your code snippet. The code snippet you’ve sent would print the NIP number in the order data (column on the right). But you are checking if the template type is ‘nummer-nip’ which is it isn’t. The available template types are ‘invoice’ and ‘packing-slip’ (for the free version). So the snippet won’t print anything in the order data column.
To print the NIP number in the order data column try this:
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_numer_nip_') ) ) {
?>
<tr class="nip-number">
<th><?php _e( 'Numer NIP:', 'woocommerce-pdf-invoices-packing-slips' ); ?></th>
<td><?php echo $order->get_meta('_billing_numer_nip_'); ?></td>
</tr>
<?php
}
}
This code snippet should go in the functions.php of your child theme.
The NIP number right now is added to the billing address. So if you want to remove it there please read the following guide: Changing the address format
Hi!
Thanks for the answer.
How could I place it under customer Phone number?
Plugin Contributor
kluver
(@kluver)
Hi @bartskol,
The customer’s phone number is also part of the billing address so you will have to customize the address format: Changing the address format
So how could i change it with woocommerce wide?
-
This reply was modified 6 years, 9 months ago by
bartskol.
Plugin Contributor
Ewout
(@pomegranate)
This is explained on that same documentation page michael linked to: Changing the address format – WooCommerce wide