Okay
  Public Ticket #2035423
Product Category
Closed

Comments

  •  1
    UgurJR started the conversation

    Hi! As you can see in attached screenshot when I create a variation product, in the category page, the lowest and the highest prices are shown for the product. But I would like to show only the lowest price. Is it possible?

    I have a lot of variation products on the website and it is important for me to show their lowest price in the category page. If it is not possible due to the theme of my website and you have a CSS code for that, would you send it to me? In case you guide me where I should add the code, I can add it by myself.


    Many thanks.

    Uğur



  • [deleted] replied

    Hi Ügur,

    Sure that is possible, you can achieve this by adding this code in functions.php:

    add_filter( 'woocommerce_variable_sale_price_html', 'get_min_variation_price_format', 10, 2 );
    add_filter( 'woocommerce_variable_price_html', 'get_min_variation_price_format', 10, 2 );
    function get_min_variation_price_format( $price, $product ) {
        $min_variation_price = $product->get_variation_regular_price( 'min' );
        return wc_price( $min_variation_price );
    }

    This will return the minimum price of variation. I have tested and it worked.