Home / Topic / WCMp PDF Invoice / Display the SKUs of the products on the invoice and the delivery note
Display the SKUs of the products on the invoice and the delivery note Resolved
Display the SKUs of the products on the invoice and the delivery note
@kevajo, may I know what are you referring to as “Delivery Note”, a scrrenshot will be very much appreciated.
I have attached an example of an invoice or delivery note.
We would like the SKUs of the products to appear on the invoices and delivery slip to facilitate the collection of the product.
Hi,
for display the SKUs of the products on the invoice
please add this code in the function.php of the current active theme :
add_action( 'after_wcmp_pdf_invoice_template_item_meta','wcmp_pdf_invoice_add_SKU',10,3);
function wcmp_pdf_invoice_add_SKU($pdf_type,$item,$order){
$product = $item->get_product();
if($product->get_sku()){
?>
<ul class="meta">
<li class="item-meta"><span><?php echo __('SKU','wcmp-pdf_invoices'); ?>:</span>
<span><?php echo __($product->get_sku(),'wcmp-pdf_invoices'); ?></span>
</li>
</ul><?php
}
}
Copy
for display the SKUs of the products on the delivery note
Override wcmp-pdf_invoices/templates/wcmp_packing_slip_first_template.php template by copying it to yourtheme/wcmp-pdf-invoices/wcmp_packing_slip_first_template.php
add this code after line no 86
<?php $product = $item_obj->get_product();
if($product->get_sku()){
?>
<ul class="meta">
<li class="item-meta"><span><?php echo __('SKU','wcmp-pdf_invoices'); ?>:</span>
<span><?php echo __($product->get_sku(),'wcmp-pdf_invoices'); ?></span>
</li>
</ul>
<?php } ?>
Copy
We have not received any update from you for a long. Hope this ticket is already been resolved.
We are now closing this ticket. Kindly create a new one if you need any further help.
The topic ‘Display the SKUs of the products on the invoice and the delivery note’ is closed to new replies.