Product variations price display - by Darja

This topic has 6 replies, 2 voices, and was last updated 5 years, 1 months ago ago by Rose Tyler

  • Avatar: Darja
    Darja
    Participant
    March 26, 2019 at 11:30

    Hello,

    I have two questions about modifying the price display for variable products.

    Firstly we would like to display in the shop and the category pages for it doesn’t show price range but instead “from: xx €”

    Second question: on single product page we would not like to display price range just display the price when a customer picks a variation.

    Can you help us with these modifications?
    Thank you for the support

    Darja

    Please, contact administrator
    for this information.
    5 Answers
    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    March 26, 2019 at 11:44

    Hello,

    1) You can add this code In functions.php of child-theme:

    add_filter( 'woocommerce_variable_price_html', 'custom_variation_price_format_min', 9999, 2 );
      
    function custom_variation_price_format_min( $price, $product ) {
        $prices = $product->get_variation_prices( true );
        $min_price = current( $prices['price'] );
        $price = sprintf( __( 'From: %1$s', 'woocommerce' ), wc_price( $min_price ) );
        return $price;
    }

    Read more – https://businessbloomer.com/disable-variable-product-price-range-woocommerce/
    2)
    remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_price', 10 );
    https://businessbloomer.com/woocommerce-visual-hook-guide-single-product-page/

    Regards

    Avatar: Darja
    Darja
    Participant
    March 26, 2019 at 14:41

    Hello,

    Thank you for your help. The first part worked perfectly but the second that is about removing the price didn’t work. We copied the code provided exactly in functions.php file of the child theme.

    Thank you for your support

    Please contact administrator
    for this information.
    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    March 26, 2019 at 15:19

    Hello,

    In this case, you can remove the price using custom CSS code:

    .product-summary-fixed .price {
        display:  none;
    }

    Regards

    Avatar: Darja
    Darja
    Participant
    March 28, 2019 at 09:49

    Hello,

    Thank you for your support. It now shows as we want it.

    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    March 28, 2019 at 09:52

    Hello,

    You’re welcome!
    Would you mind to rate our product: https://prnt.sc/d256m6 https://themeforest.net/downloads
    That would be much appreciated ?

    Regards

  • Viewing 6 results - 1 through 6 (of 6 total)

The issue related to '‘Product variations price display’' has been successfully resolved, and the topic is now closed for further responses

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.