Created
April 25, 2024 05:19
-
-
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) )
This file contains 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 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