- Web templates
- E-commerce Templates
- CMS & Blog Templates
- Facebook Templates
- Website Builders
WooCommerce. How to remove variable products available price range
June 2, 2016
This video tutorial is going to show you how to remove variable products available price range in WooCommerce templates.

-
Connect to your FTP/File Manager, follow this path: wp-content/themes/themeXXXXX/includes and look for custom-function.php file to edit.
You can also find this custom-function.php file under the Appearance > Editor in WordPress admin panel.
In order to remove the larger value of the price, we should add the following code to custom-function.php – before the closing tag ?> to the bottom of the file:
/* Disable Variable Product Price Range: */ add_filter( 'woocommerce_variable_sale_price_html', 'my_variation_price_format', 10, 2 ); add_filter( 'woocommerce_variable_price_html', 'my_variation_price_format', 10, 2 ); function my_variation_price_format( $price, $product ) { // Main Price $prices = array( $product->get_variation_price( 'min', true ), $product->get_variation_price( 'max', true ) ); $price = $prices[0] !== $prices[1] ? sprintf( __( '%1$s', 'woocommerce' ), wc_price( $prices[0] ) ) : wc_price( $prices[0] ); // Sale Price $prices = array( $product->get_variation_regular_price( 'min', true ), $product->get_variation_regular_price( 'max', true ) ); sort( $prices ); $saleprice = $prices[0] !== $prices[1] ? sprintf( __( '%1$s', 'woocommerce' ), wc_price( $prices[0] ) ) : wc_price( $prices[0] ); if ( $price !== $saleprice ) { $price = '
' . $saleprice . '' . $price . ''; } return $price; }Here is the result:
-
To remove the price range completely, we will add the following code to the custom-function.php – before the closing tag ?> to the bottom of the file.
/* Disable Variable Product Price Range completely: */ add_filter( 'woocommerce_variable_sale_price_html', 'my_remove_variation_price', 10, 2 ); add_filter( 'woocommerce_variable_price_html', 'my_remove_variation_price', 10, 2 ); function my_remove_variation_price( $price ) { $price = ''; return $price; }
Below you can see the result of adding the code:
Feel free to check detailed video tutorial below.
WooCommerce. How to remove variable products available price range