please check that why this is not working
Posted by:
kushafaka
Aug 11, 2017 at 07:52 (7 year ago)
function cw_change_product_price_display( $price_html ) {
global $product;
global $woocommerce;
if ( $product->is_on_sale() ) {
return $price_html;
}
elseif($product->get_sale_price()){
$price =wc_price($product->get_sale_price());
return $price_html . $price;
}
else{
return $price_html;
}
}
add_filter( 'woocommerce_get_price_html', 'cw_change_product_price_display' );
my this function is working porperly for simple products but not working on variable products will you tell me how to sort this
global $product;
global $woocommerce;
if ( $product->is_on_sale() ) {
return $price_html;
}
elseif($product->get_sale_price()){
$price =wc_price($product->get_sale_price());
return $price_html . $price;
}
else{
return $price_html;
}
}
add_filter( 'woocommerce_get_price_html', 'cw_change_product_price_display' );
my this function is working porperly for simple products but not working on variable products will you tell me how to sort this