Last active
May 21, 2024 06:38
-
-
Save webtoffee-git/8b352f115725a998279b057f2755ec5d to your computer and use it in GitHub Desktop.
Alter packing slip item quantity using WooCommerce PDF Invoices, Packing Slips, Delivery Notes and Shipping Labels plugin
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php //Do not add this line of code | |
add_filter('wf_pklist_alter_package_item_quantiy', 'alter_packing_slip_quantiy', 10 , 5); | |
function alter_packing_slip_quantiy($item_quantity, $template_type, $_product, $item, $order) | |
{ | |
if( 'packinglist' === $template_type ){ | |
if( $item_quantity>1 ){ | |
$item_quantity = '<span style="color:red;">'.$item_quantity.'</span>'; | |
} | |
} | |
return $item_quantity; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment