Skip to content

Instantly share code, notes, and snippets.

@webtoffee-git
Created February 13, 2020 05:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save webtoffee-git/8b352f115725a998279b057f2755ec5d to your computer and use it in GitHub Desktop.
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
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($template_type=='packinglist')
{
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