Untitled

 avatar
unknown
plain_text
5 months ago
327 B
5
Indexable
add_filter('woopb_added_sub_price', function($price_html, $product_id, $item){
	$product = wc_get_product($product_id);

	if (!$product){
		return $price_html;
	}

	if ($product->is_on_sale()){
		$price = $product->get_sale_price();
	} else {
		$price = $product->get_regular_price();
	}
	
	return wc_price($price);

}, 10, 3);
Editor is loading...
Leave a Comment