It is possible to:
- set product step quantity in multiples of 10 starting from a minimum of 50 for a specific category [solved].
- change the price only at the thresholds of quantities 100 and 200 for a specific product? For example:
- charge 1$ per single product from 50 to 90 (quantities);
- charge 0.7$ per single product from 100 to 190 (quantities);
- charge 0.5$ per single product up to 200 (quantities).
Edit:
I solved part one with those answers:
2
Answers
Thank you. Since there are a lot of product with different discount % do I have to write this function x times? Maybe is better to looking for a plugin right?
Exceptionally, I answer your question as we expect from you to provide a real code attempt in your question. Also next time, ask one question at the time, it’s the rule on Stack OverFlow.
So, the following code will answer to your 2 question. It will chnage the product price based on quantity thresholds, for specific products.
In the first function, you will define in the array the targeted product Ids.
In The 2nd function, you will set your quantity thresholds and price rates.
This code works for simple products (not for variable products / product variations):
Code goes in functions.php file of your child theme (or in a plugin). Tested and works.
Addition:
To target product categories (or product tags) instead of product IDs, replace the first function with:
For product tags, replace
'product_cat'
with'product_tag'
.