Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
409 B
0
Indexable
Never
add_filter('b2bking_filter_wholesale_price_final', function($price, $retail_text, $retail_price, $wholesale_text, $wholesale_price, $product_id){
	// calculate percentage
	$percent = b2bking()->reverse_wc_price($wholesale_price) / b2bking()->reverse_wc_price($retail_price) * 100;
	$price .= '<br><span style="font-weight:bold;font-size:17px">Buy now and save '.$percent.'%</span>';
	return $price;
}, 10, 6);