Hide Variable Price Range

  • No Bulky Libraries Used
  • 3-Days Return Policy
  • Easy to use

Product Description

Paste the code under functions.php or as a Code Snippet
add_action( 'woocommerce_variable_add_to_cart', 'cds_change_price_with_variation_price' );

function cds_change_price_with_variation_price() {
global $product;
$price = $product->get_price_html();
wc_enqueue_js( "
$(document).on('found_variation', 'form.cart', function( event, variation ) {
if(variation.price_html) $('.summary > p.price').html(variation.price_html);
$('.woocommerce-variation-price').hide();
});
$(document).on('hide_variation', 'form.cart', function( event, variation ) {
$('.summary > p.price').html('" . $price . "');
});
" );
}

Reviews (0)

Reviews

There are no reviews yet

Add a review
Hide Variable Price Range Hide Variable Price Range
Rating*
0/5
* Rating is required
Your review
* Review is required
Name
* Name is required
Add photos or video to your review