• Hi,
    on my website I have single products and variable products.
    The price appears normal for single products (below the title), however for variable products the price is displayed twice on the single product page (beneath the header and above the add to cart button).
    How can I remove the price range beneath the header without either removing the single product price or removing the price range on the shop page too?

    I tried this and it worked perfectly for variable products, however then the price for single products doesnt appear anymore:
    remove_action( ‘woocommerce_single_product_summary’, ‘woocommerce_template_single_price’, 10 );

    any ideas?

    thanks a lot! ??

    https://www.ads-software.com/plugins/woocommerce/

Viewing 1 replies (of 1 total)
  • Caleb Burks

    (@icaleb)

    Automattic Happiness Engineer

    The range shows up by default in case a variation isn’t selected yet. Then the actual variations price shows up once the attributes have been selected.

    The easiest way to accomplish what you are looking to do though is to hide the variation default price range with some CSS.

    To truly remove it, you will need to use a snippet like this:

    add_filter( 'woocommerce_variable_sale_price_html', 'wc_ninja_remove_variation_price', 10, 2 );
    add_filter( 'woocommerce_variable_price_html', 'wc_ninja_remove_variation_price', 10, 2 );
    function wc_ninja_remove_variation_price( $price ) {
    	return;
    }

    Warning though, if the variations all have the same price, the above snippet will make it so no prices appear on the variable product page. So if you have that occurring on your site, you will need to adjust the above snippet to only return empty if not all variations are the same price.

Viewing 1 replies (of 1 total)
  • The topic ‘remove duplicate price range for variable products’ is closed to new replies.