lunar
lunar copied to clipboard
Provide an option to automatically add BuyXGetY discount rewards
3rd times a charm?
This PR provides an option to automatically add BuyXGetY discount rewards.
It adds a toggle to the discount create/edit screen to automatically add.
When selected we work out if any rewards are available that haven't yet been added to the cart and if we so we add them. Along the way we keep track of how many we added, so we can decrement/increment if cart values are changed, and if necessary remove the item from the cart when it no longer is eligible.
Devs can check for whether an item was added by discount by checking the meta->added_by_discount array values ... if the sum is the same as the cart line quantity then it was added by a discount and can be displayed differently (if required).
Replaces https://github.com/lunarphp/lunar/pull/881 Closes https://github.com/lunarphp/lunar/issues/876
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
lunar-docs | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Feb 23, 2024 8:47am |
Hi @ryanmitchell, apologies for taking so long to review this. However, we're not looking to add new functionality to the v0.8 release now. Could this be ported to v1.x?
3rd time isn't a charm then 😄 I'll get a look in the next few days.
3rd time isn't a charm then 😄 I'll get a look in the next few days.
Sorry :-)