Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Contributor Claudio Sanches

    (@claudiosanches)

    You can use the woocommerce_variable_price_html filter to change the price of your variable products, inside your function you can check for if ( ! is_product() ) and avoid to display the changed price in the product screen.

    Thread Starter morserus

    (@morserus)

    Claudio… can u please tell me what is the exact code to add to functions.php? I dont know much about codes… but I know wherethe functions.php is and how to copy past =)

    Thx

    Thread Starter morserus

    (@morserus)

    I found this code here that do what I want… but it also affects the item page. I want it to affect only the store page.

    ——————-

    // show only max price //

    /**
    * Only display maximum price for WooCommerce variable products
    **/

    add_filter(‘woocommerce_variable_price_html’, ‘custom_variation_price’, 10, 2);
    function custom_variation_price( $price, $product ) {
    $price = ”;
    $price .= woocommerce_price($product->max_variation_price);
    return $price;
    }

    Plugin Contributor Claudio Sanches

    (@claudiosanches)

    Yes, that’s why I said:

    you can check for if ( ! is_product() ) and avoid to display the changed price in the product screen.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Change Display Prices’ is closed to new replies.