• Resolved bitfenix

    (@bitfenix)


    Hello,
    I need to add css in the invoice when the product quantity is bigger than 5. In my premium plugin version I have filter which I can use for quantity:

    add_filter('wf_pklist_alter_item_quantiy', 'wt_pklist_item_qty', 10, 5);
    
    function wt_pklist_item_qty($order_item_qty, $template_type, $_product, $order_item, $order) {
    
    	/* custom code */
    	return $order_item_qty;
    }

    This would need to go in the loop since I need to alter cell only where quantity is bigger than 5 and not the others when qty is smaller

    add_filter('wf_pklist_alter_item_quantiy', 'wt_pklist_item_qty', 10, 5);
    
    function wt_pklist_item_qty($order_item_qty, $template_type, $_product, $order_item, $order) {
    
    	if ($order_item_qty > 5) {
    		foreach ($something as $somethings) {
    			$order_item_qty .= '<style> .quantity_td { color: #blue; font-size: 29px; } </style>';
    		}
    	}
    
    	return $order_item_qty;
    }

    If my approach is correct could you help with the foreach loop part?

    • This topic was modified 2 years ago by bitfenix.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘order_item_qty in the loop’ is closed to new replies.