Looking to hide price ranges for variation products in WooCommerce?
Now, let’s get started!

Contents
What is the price range for variation products in WooCommerce?
Variant products allow you to sell the same product in different sizes, colors, weights, etc. You can also define different prices for each variant.
By default, prices for variations will be displayed as ranges on the product page.

That said, displaying price ranges is not always preferred by WooCommerce owners.
Let’s say a customer visits your site looking for a jacket that costs $20. If your variation product shows a price range of $20 – $30, customers are likely to leave your product page and you lose your potential sales. In this case, you should consider showing only the minimum price of the range.
In other cases, you may want to completely hide the prices for your variation products. Only when a visitor selects a particular variant will the price be displayed. This entices your visitors to click on variations for more details and thus, increases your chances of converting visitors into customers.
How to hide price ranges for variant products in WooCommerce?
To hide price ranges from variation product pages, open the functions.php file of your theme or child theme. You can find this file under Appearance > Edit Appearance in your admin dashboard.
If you are having trouble creating a sub-theme, you can use the Code Snippets plugin .
When you’re ready, get started!
Hide maximum prices for variant products in WooCommerce
As mentioned above, sometimes you just want to show the minimum price. This code will help you achieve that. Just add the following code to the function.php file in your theme.
function wc_varb_price_range( $wcv_price, $product ) {
$prefix = sprintf('%s: ', __('From', 'wcvp_range'));
$wcv_reg_min_price = $product->get_variation_regular_price( 'min', true );
$wcv_min_sale_price = $product->get_variation_sale_price( 'min', true );
$wcv_max_price = $product->get_variation_price( 'max', true );
$wcv_min_price = $product->get_variation_price( 'min', true );
$wcv_price = ( $wcv_min_sale_price == $wcv_reg_min_price ) ?
wc_price( $wcv_reg_min_price ) :
'<del>' . wc_price( $wcv_reg_min_price ) . '</del>' . '<ins>' . wc_price( $wcv_min_sale_price ) . '</ins>';
return ( $wcv_min_price == $wcv_max_price ) ?
$wcv_price :
sprintf('%s%s', $prefix, $wcv_price);
}
add_filter( 'woocommerce_variable_sale_price_html', 'wc_varb_price_range', 10, 2 );
add_filter( 'woocommerce_variable_price_html', 'wc_varb_price_range', 10, 2 );
<div>
<span>1</span><span>2</span><span>3</span><span>4</span><span>5</span><span>6</span><span>7</span><span>8</span><span>9</span><span>10</span><span>11</span><span>12</span><span>13</span><span>14</span><span>15</span><span>16</span><span>17</span><span>18</span><span>19</span><span>20</span><span>21</span><span>22</span><span>23</span><span>24</span><span>25</span><span>26</span><span>27</span><span>28</span><span>29</span>
</div>
Your variant products will only show the lowest price. The exact price for each variation will appear above the Add to Cart button upon selection.

Epilogue
I hope with this change, your store will be more efficient.
If you find it interesting, you can follow the WordPress basics section to know more new knowledge.
Follow fanpage to receive the latest posts: Group

