Skip to content
Advertisement

Add 50% discount per 3 products on the cheapest products (WooCommerce)

I’m adding the discount rule for every 3 products: 3,6,9,12,15.. on the cart and it should apply to discount 50% only the cheapest products.

So if you have 9, only the 3 cheapest gets 50% off.

This code applies a discount to all products, so it should only be every 3 products

JavaScript

I have attached a screenshot, you can see there is a red outline for every 3rd cheapest product.

Advertisement

Answer

This code will apply a 50% discount per 3 products on the cheapest products.

JavaScript
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement