Remove wholesale word on strikeout for Wholesale Prices By RymeraWebCo
Remove wholesale word on strikeout for Wholesale Prices By RymeraWebCo
global $wdr_comp_disable_strikeout;
add_filter('wwp_filter_wholesale_price_html', function($wholesale_price_html , $price , $product , $user_wholesale_role , $wholesale_price_title_text , $raw_wholesale_price , $source){
global $wdr_comp_disable_strikeout;
$wdr_comp_disable_strikeout[$product->get_id()] = true;
$result = apply_filters('advanced_woo_discount_rules_get_product_discount_price_from_custom_price', $raw_wholesale_price, $product, 1, $raw_wholesale_price, 'discounted_price', true);
if($result !== false){
/*To remove the original price strikeout un-comment the next line */
/*$wholesale_price_html = preg_replace('/<del.*<\/del>/', '', $wholesale_price_html);*/
$wholesale_price_html = "<del>".$wholesale_price_html."</del><ins>".wc_price($result)."</ins>";
}
return $wholesale_price_html;
}, 10, 7);
add_filter('advanced_woo_discount_rules_modify_price_html', function($enable, $price_html, $product, $quantity){
global $wdr_comp_disable_strikeout;
if(isset($wdr_comp_disable_strikeout[$product->get_id()]) && $wdr_comp_disable_strikeout[$product->get_id()] == true){
$enable = false;
}
return $enable;
}, 10, 4);