openfoodnetwork
openfoodnetwork copied to clipboard
[Split Checkout] Message 303 when order cycle closes during checkout
Description
Follow up of #9688.
In #9688 the redirections and error messages when the order cycle closed during checkout were fixed for our legacy checkout. For Split Checkout the situation got worse, see below.
Expected Behavior
- When clicking 'Next' on any of the three Split Checkout pages, the user should be redirected immediately
- if shop has no order cycles open -> redirect to shop homepage (closed shopfront)
- if shop has 1 order cycle open -> redirect to /shop; automatically select that order cycle
- if shop has 2 order cycles open -> redirect /shop; do not select an order cycle
- in all the above cases, display the correct error message (from en.yml -> order_cycle_closed)
- 404 should not occur
- 303 should not occur
Actual Behaviour
- the first click on 'Next' doesn't do anything (Message 303 in the browser) :x:
- only the second click works as expected ✔️
- redirections are ok ✔️
- error messages are ok ✔️
Steps to Reproduce
The following should be tested for
- legacy checkout and split checkout
- all steps on split checkout (1 - Your details, 2 - Payment method, 3 - Order summary)
- cash, paypal and stripe payments
- zero, one and two or more remaining open order cycles after closing the current one
- Login as user
- Create an order in an order cycle
- Get to the checkout screen (/checkout)
- As the enterprise owner, close the order cycle
- As the user, click on 'Next' or 'Order now' on the checkout step of interest
- Ascertain that you are redirected to the shop front according to the 'expected behavior' above
- Ascertain that there's a flash message informing you that the OC just closed
Animated Gif/Screenshot
Workaround
Severity
bug-s3: a feature is broken but there is a workaround
Your Environment
- Version used:
- Browser name and version:
- Operating System and version (desktop or mobile):
Possible Fix
Thanks for creating this issue @drummer83 I'll take it up.
I don't have split checkout enabled in my local app, could you tell me how to do that?
It's the reason I didn't know that this issue existed. I thought my PR should work for both but seems like it doesnot :disappointed:
Hi @binarygit,
Of course, you need to log in as super admin and follow the instructions provided here: https://github.com/openfoodfoundation/openfoodnetwork/wiki/Feature-toggles
Don't hesitate to ask if anything is unclear.
hello @binarygit are you still working / planning to work on this one?
yes I'm working on it. Just haven't been able to figure out the offending code, which is why it's taking me sometime. Also got distracted by the angular work. Will try to close soon.