Home Forums WoodMart support forum Hide Price Range for Variable Products and Update Main Price on Variation Select

Hide Price Range for Variable Products and Update Main Price on Variation Select

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #712553

    davidoiuvlad
    Participant

    Hello!

    We have variable products on the website, and the client would like the price range not to be displayed. Instead, they want only the starting price (minimum price) to appear.

    To achieve this, I added the following code:
    add_filter( ‘woocommerce_variable_price_html’, ‘show_minimum_price_only’, 10, 2 );
    function show_minimum_price_only( $price, $product ) {
    $min_price = $product->get_variation_price( ‘min’, true );
    return wc_price( $min_price );
    }
    Now the starting price is displayed correctly. However, when a variation is selected, the price for that variation appears below in small text.

    The client would like this small final price to disappear and instead have the main price at the top (the large one) update dynamically when a variation is selected.

    I have attached some explanations/screenshots for clarity.

    Attachments:
    You must be logged in to view attached files.
    #712764

    Aizaz Imtiaz Awan
    Keymaster
    Xtemos team

    Hello,

    For this, there is no need to use the custom code. Please delete the custom code from the site, and go to Theme Settings >> Shop >> Variable Products >> Price section: https://ibb.co/Kp59pm20

    Best Regards.

Viewing 2 posts - 1 through 2 (of 2 total)