• Resolved salume101

    (@salume101)


    hello team, I have custom code in my functions.php and I see below warning:
    sale_price was called incorrectly.
    regular_price was called incorrectly.

    and this is my code:
    if( $product->is_on_sale() ) {
    $percentage = round( ( ( $product->regular_price – $product->sale_price ) / $product->regular_price ) * 100 );
    return ‘<span class=”onsale”>٪’.$percentage.'</span>’.$price;
    }
    return $price;
    }

    how should I have to call sale_price and regular_price?

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘regular_price was called incorrectly’ is closed to new replies.