Skip to content

Instantly share code, notes, and snippets.

@webtoffee-git
Created April 25, 2024 05:19
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/e1d47ad6b384fc0d8f117f2bcd793d0e to your computer and use it in GitHub Desktop.
Save webtoffee-git/e1d47ad6b384fc0d8f117f2bcd793d0e to your computer and use it in GitHub Desktop.
Code for Changing Item Quantity Color in WooCommerce Invoice document - By WebToffee ( WooCommerce PDF Invoice, Packing Slips, Delivery Notes and Shipping labels (free) )
<?php> //Do not copy this line of code
add_filter('wf_pklist_alter_item_quantiy', 'wt_alter_invoice_quantiy', 10 , 5);
function wt_alter_invoice_quantiy($item_quantity, $template_type, $_product, $item, $order)
{
if( 'invoice' === $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