• Resolved bitfenix

    (@bitfenix)


    Hi, I need to alter sale price (when there is any) shown in the invoice and I’ve tried to get on sale product with this:

    add_filter('wf_pklist_alter_item_price', 'wt_pklist_item_price', 10, 5);
    function wt_pklist_item_price($item_price, $template_type, $_product, $order_item, $order) {
    	if( $_product->is_on_sale() ) {
    		// do something
        }
    }

    But this didn’t worked. Any suggestion how to achieve this? Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support WebToffee Support

    (@webtoffeesupport)

    Hi @bitfenix,

    Thanks for reaching out.

    You can use the filter?wf_pklist_alter_item_price_formated?instead to alter the item sale price if any. Here is the sample code which might be helpful for you:

    add_filter('wf_pklist_alter_item_price_formated', 'wt_pklist_item_price_formated', 10, 6);
    function wt_pklist_item_price_formated($item_price_formated,$template_type,$item_price,$_product,$order_item,$order) {
    	if( $_product->is_on_sale() ) {
    		// do something
        }
    	return $item_price_formated;
    }
    Thread Starter bitfenix

    (@bitfenix)

    This works very well, thank you!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Get on sale product’ is closed to new replies.