-
Notifications
You must be signed in to change notification settings - Fork 174
Description
What are you trying to do?
I'd like to run a promotion where if a user add 2 items of the similar category, the one with the lower price is included at no charge.
Of course, a more robust solution would be to allow more flexibility (Buy n, Get x free)
What's your proposed solution?
- Look in user's cart for all items that match the sale/promotion
- Based on the sale, calculate the number of items that should be free (For example a B1G1 sale and there are 2 items in the cart)
- Apply discount (lowest priced matching item)
Current solution
The current, best solution is to create a series of discounts. Here is an example of how we ran a Buy 2 Get 1 Free promotion.
This requires creating a discount for each possible count of matching items in a cart.
If all items are the same price, this is effectively the same. However if the products are different prices, the amount of discount is actually greater. (Example: 1 shirt for $20 and 1 shirt for $10. Under this setup, the discount would be $15. It should be $10 instead)
Additional context
Ideally, this should work for multiples of the sale as well. For example in a Buy 1 Get 1 Free sale, if a user adds the following items to their cart:
- Item 1 - $15
- Item 2 - $15
The discount should be $15.
However, if they add 2 more matching items:
- Item 3 - $5
- Item 4 - $5
Then the total discount should: $10 (b/c items 3 and 4 are the two lowest priced items)

