In WooCommerce, I have a category of products called Samples, each sample costs $2.99. But I'd like a way to automatically change the cost of the Samples from $2.99 to $1 when 5 Samples are added to cart.
So if 4 samples are added to cart, the total would be $11.96… but if 5 were added the total would be $5.
So for every 5 products, the product price would change from $2.99 to $1 but if 6 Samples were added to cart the total would be $7.99 and if 10 were added the total would be $10 etc...
How could I achieve this?
Thanks.
Here is something that should be convenient to your requirements.
This function will add discount to cart:
Code goes in function.php file of your active child theme (or active theme). Tested and works.