Change product price based on the quantity or pcs in woocommerce
Many online woocommerce stores especially wholesale stores need the functionality of dynamically changing product price based on the quantity selected. We can achieve this functionality manually and using plugins as well. However, in this article, I will discuss two methods without using manual coding that you can use to change price based upon the quantity selected.
1: Use Plugin “WooCommerce Tiered Price Table”
WooCommerce Tiered Price Table is the Free plugin that will allow you to set different prices for different quantity range. After activating the plugin you will see the Tier Pricing Section (with Quantity and Price Fields) in the General Tab of Simple Product and under variations for Variable Products.
For example: if you will set 3 tiers pricing like:
Quantity = 5 => Price = $17
Quantity = 10 => Price = $15
Quantity = 20 => Price = $14.5
With regular price = $20 and sale price = $18 then dynamic pricing will change dynamically in the following sequence.
When quantity less than 5 will be selected price will be $18(i.e. sale price. If the sale price is empty then the regular price will be applied).
When Quantity selected is in the range of 5 – 10 then $17 will be applied.
For 10 – 20 dynamic price of $15 will get applied and for quantity 20+ the price will remain $14.5.
2. Make use of Woocommerce Variations
The second method to sell your products with dynamic pricing for different quantities is the use of default woocommerce variations options. The variations in woocommerce allow us to set different variations of products. This method can be useful for wholesalers who want to sell a fixed set of quantities. For example 1000 items, 2000 items, etc.
Step by Step Process
- In woocommerce Product, select product type as “Variable Product”.
- In attributes create attribute with name “Number of Pieces” and add values as set of quanties or fixed number of pieces of products separated by “|” (for example: 100|1000|3000) that you want to sell. After adding all values separated by “|” click on “save” button.
- Click on Variations. From Dropdown choose “add variations” and click on “Go”. Woocommerce will automatically generate all combination of variations.
- You can set different price for each variation.
- Click save variations button and then publish/update the product.
Now customers will see dropdown options choose from “100”, “1000” or “3000” and the price will be shown and charged accordingly.
If you have any questions related to this tutorial or need any help feel free to let me know in the comments.