• Resolved kroozing

    (@kroozing)


    I have got the rules set up for a certain type of role.
    Customer
    Trade Customer
    For the trade customer they would get a discount that works well but instead of showing the strike through price i would like to show the price as £0.00 rrp.
    Is this possible?

Viewing 1 replies (of 1 total)
  • Hi, kroozing,

    Paste the following code in the functions.php of your theme:

    add_filter('woocommerce_get_price_html', function($priceHtml, $product) {
        $processedProduct = adp_functions()->calculateProduct($product, 1);
    
        if (is_null($processedProduct)) {
            return $priceHtml;
        }
    
        if ($processedProduct->areRulesApplied()) {
            $priceHtml = "<del>" . wc_price(0) . "</del> " . $priceHtml;
        }
    
        return $priceHtml;
    }, PHP_INT_MAX, 2);
Viewing 1 replies (of 1 total)
  • The topic ‘Instead of strike through show rrp next to old price’ is closed to new replies.