You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is treated as one issue, as it seems to me (I might be wrong) that this is all coming from the same root cause. Also related to #10855
After adding a voucher and while on the confirmation page, the user may opt for returning to either the /cart page (editing quantities, for ex.):
If there are no taxes on the order/voucher -> voucher is removed from the order
If there are taxes on the order/voucher, and voucher amount > order.total -> snail
If there are taxes on the order/voucher, voucher amount <= order.total -> additional parcels will be created for the voucher, on each /summary page visit, till a snail is triggered
I had a quick look at this, I believe it's due to VoucherAdjustmentsService.calculate recalculating the voucher adjustment when it shouldn't. My first though is that we need to check if the voucher_adjustment.state is "closed", if so ignore any calculation.
But then I am pretty sure there are scenarios where it makes sense to recalculate the voucher adjustment (ie, quantity have been changed via /cart page) so we'll have to figure out how to handle that. We can look at what happen to other adjustment when the checkout flow is reset, and do something similar for voucher adjustment, and/or set the existing voucher_adjustment.state to "open" (and maybe update order total ?) so it is calculated again.
Description
This is treated as one issue, as it seems to me (I might be wrong) that this is all coming from the same root cause. Also related to #10855
After adding a voucher and while on the confirmation page, the user may opt for returning to either the /cart page (editing quantities, for ex.):
voucher amount
>order.total
-> snailvoucher amount
<=order.total
-> additional parcels will be created for the voucher, on each /summary page visit, till a snail is triggeredBugsnag
https://app.bugsnag.com/yaycode/openfoodnetwork-uk/errors/6464d03f630d0f000895ebe9?filters[event.since]=30d&filters[error.status]=open&filters[app.release_stage]=staging&event_id=6464d90700bd31520e150000
Expected Behavior
The user should be able to iterate between
/summary
and the/cart
pages.Actual Behaviour
Iterating between the
/cart
and/summary
pages triggers a snail.Steps to Reproduce
For all voucher issues: per-requisites are:
An order/line item/customer with no taxes:
/summary
stepno taxes on the order/voucher
taxes on the order/voucher, and
voucher amount
>order.total
-> snailAnimated Gif/Screenshot
Workaround
/cart
pageThe text was updated successfully, but these errors were encountered: