lunar icon indicating copy to clipboard operation
lunar copied to clipboard

Provide an option to automatically add BuyXGetY discount rewards

Open ryanmitchell opened this issue 1 year ago • 1 comments

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

ryanmitchell avatar Dec 19 '23 09:12 ryanmitchell

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

vercel[bot] avatar Dec 19 '23 09:12 vercel[bot]

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?

glennjacobs avatar May 08 '24 11:05 glennjacobs

3rd time isn't a charm then 😄 I'll get a look in the next few days.

ryanmitchell avatar May 08 '24 11:05 ryanmitchell

3rd time isn't a charm then 😄 I'll get a look in the next few days.

Sorry :-)

glennjacobs avatar May 08 '24 11:05 glennjacobs