How To Disable Variable Product Price Range In WooCommerce

Suppose, you are surfing different online stores for buying a new hoody. Luckily, you have found the one you have been looking for. So, what's the next thing you will notice? The PRICE!

Now, if you see a price range higher than your budget, you will hesitate to buy that product. The seller provided a range because the product has variations. For example, the hoody you liked has 2 colors red and black. The seller is charging more for the red one. Some buyers like you might want to buy the black one, but they would be confused because of the price range. Unless you select the color, you will never know the actual price!

When you are a store owner, you can guess a similar scenario using reverse psychology. So, when you place a higher range, customers will surely bounce from your product page and you lose your potential sales.

Variable Product Price WooCommerce

Thus, a common strategy would be to show the minimum price of the range. If you are a WooCommerce store owner, you cannot modify the price range format of variable products, sad but true!

WooCommerce is one of the most popular eCommerce solutions for WordPress. Currently, it powers almost 28% of all the online stores around the world. Impressive, right? To amaze you more – WooCommerce held 41% of 2017 market share. And it is still increasing!

Today, we are not going to discuss that. Instead, we are here with a valuable piece of tutorial for store owners using WooCommerce. We will show you – how easily you can change the behavior of the price range format that WooCommerce stores display for Variable Products.

Price Range in WooCommerce Store for Variable Products

In WooComerce, there are many types of products. Variable products are one of them and play a vital role when you are trying to sell products with different variations.

Thanks to WooCommerce, you can create variations of the same product. This means it is possible to create a single product with multiple sizes, colors, weight etc. Besides that, you can set different prices for the variations of your product. So, when you create a variable product with multiple prices, the price of the product is shown as a range on the product page. If you create a variable product with different prices, you would see the price range on the product page as something like the following screenshot.

It is common for vendors not to share the price range that he has set for a variable product. Unfortunately, WooCommerce does not let you modify the price range from its settings. So, what would you do in such scenario?

In that case, you need to make some modifications. You don't have to worry or be scared as this modification is very simple. Also, it's not difficult at all. You can easily change the price range with a few line of coding.

Here, we will provide you a simple piece of code that you can use. This will show only one price on the product page.

How to Modify WooCommerce Variable Product Price Range

For the modification, you will need to do some custom coding. If you are confused about the file location and have less concept of coding it is better to add the code to your child theme function.php file.

Now, if you do not have a child theme then you will need to create one on your website. A child theme is also safe in case you want to override template or function. you need to follow the steps below–

  • Install a child theme and activate it.
  • Create a file called help.php and insert the file into your child-theme folder.
  • Now, open the functions.php file of your child-theme and then insert below code in the file.

If you are having difficulties in creating the child theme, you can use this free plugin.

The Simple & Easy Code that You Need to Insert :

Modified Price Range in WooCommerce

After you use the code, you will get the outcome as the picture below:

You will now have a single price. When a customer will choose a different variation of a different price it will be shown above the Add to Cart button.

This is a really easy process. Just follow the instructions and control your price range on WooCommerce stores. If you face any difficulties, don't hesitate to comment.

26 Comments

  • Kostas

    Kostas

    How can i remove the word “From” ?

    • Anthony

      Anthony

      Check the line:

      $prefix = sprintf(‘%s: ‘, __(‘From’, ‘wcvp_range’));

      you can edit the whole line or edit the word From

      • carmine

        carmine

        hi but if i leave the line empty it just shows the “:” how can i just show the price? thanks

  • Ash

    Ash

    This worked wonderfully. Thanks a bunch!

    • Shamina Roshni

      Shamina Roshni

      Hello Ash,

      You are welcome 🙂

      I am glad to help.

  • John Collins

    John Collins

    This worked great!!! Amazing job.

    • Shamina Roshni

      Shamina Roshni

      Hello John,

      Thank you for the appreciation 🙂

  • Gavin

    Gavin

    Many thanks and it works perfectly for the standard products on my website. Is it possible to make it work for non standard products such as a gift card product?

    • Shamina Roshni

      Shamina Roshni

      Hello Gavin ,

      Glad to know that it was helpful to you. The code will work for only variable product. You will need different code to make the changes on a different type of product.

  • Michael

    Michael

    Do you know if you can still have the options for a variable product without showing a price at all? I have a number of products where I need to switch between for example Small, Medium & Large so that the images change but the CTA is to complete an enquiry form so I do not want prices to show on site

  • rai

    rai

    thanz! It works amazing! but how can i make it the same for all products page because now its only works on single product page.

    • Shamina Roshni

      Shamina Roshni

      Hello Rai,

      This code will work on single product page only as the variation is only shown on the single product page. You may need a different type of coding for the changes on the product page.

      Thanks

  • Linseed Studio

    Linseed Studio

    Worked perfectly – thank you!

    • Shamina Roshni

      Shamina Roshni

      Hello Linseed,

      I am happy that the blog was helpful 🙂

  • Vibeke

    Vibeke

    Thank you, just what I was looking for 🙂

    • Shamina Roshni

      Shamina Roshni

      Hello Vibeke,

      I am so glad to help you 🙂

      Good luck.

  • Tyler

    Tyler

    What would I change to show the Max price? I only have 2 possible prices and I’m looking to display them based on an if statement. Would also be helpful if there was a way to pick from more then just min and max incase i have more prices later

    • Shamina Roshni

      Shamina Roshni

      Hello,

      If you are looking to show the Max price depending on condition then I am afraid this is not the blog you are looking for. In this blog, the main goal is to hide the price range. You will need different custom coding in order to make the changes as your requirement.

      Best Regards 🙂

  • jane schaller

    jane schaller

    I am confused as to where you insert this

    Thank you

    • Shamina Roshni

      Shamina Roshni

      Hello Jane,

      We suggest not to make any changes in the core plugin code of the plugin. The best option is to make changes using a child theme. You can create a child theme and insert the code on the function.php of the child theme.

      The details to create a child theme is already mentioned on the blog.

      Thanks 🙂

  • Arp Laszlo

    Arp Laszlo

    Thanks! Does this also work on catalog pages, or just individual product pages?

    • Shamina Roshni

      Shamina Roshni

      Hello Arp,

      The code will work for the individual product page only.

      Thanks 🙂

  • Ed

    Ed

    Hi,

    thanks a lot! I created a discount for the product (25%OFF). Now the price looks like this: From: $16,90$12,68
    (Old price ($16,90) is crossed out). Thats ok, but would this be possible to display it with a space between prices?
    Something like this: From:$16,90 $12,68

    • Shamina Roshni

      Shamina Roshni

      Hello,

      I understand there is an issue on your pricing display. But unfortunately, the blog is all about to hide the variation of the pricing. You are looking for something else which is different from the mentioned code. Here I can only help you with queries related to the code I created.

      Good luck,

  • Amir Azman

    Amir Azman

    is it possible to change price display based on selected variation prices ?

    • Shamina Roshni

      Shamina Roshni

      Hello Amir,

      The code mentioned on this blog will help you hide the price of the variation. You may be able to change price display based on selective variation but you will need different code for your requirement.

      Thanks 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.