Closed duncanmcclean closed 1 year ago
Released as part of v4.5.6.
After this release the following happens when testing:
We have interrupted the default SimpleCommerce process, if I'm correct, since we handle everything on the checkout screen. Is there something additional we need to do to support this new (no stock) flow?
Simple Commerce should redirect the user back to whatever URL they were on previously (previous to being redirected to the off-site checkout page which should be the /shop/checkout/information
page)
Then on that page, if you do {{ session:errors | dump }}
, you should see an error which Simple Commerce throws that you can catch and put somewhere for the user to see.
Let me if any of that isn't working as explained and I'll see what I can do to help.
That's correct Duncan. The page redirected to is /shop/checkout/information. I just found the issue on our side. We have this code on the information page:
{{ if {sc:cart:count} === 0 }} {{ redirect to="/cart" }} {{ /if }}
Since the cart is emptied the user is automatically redirected to the (wrong) cart. So we should stay on the information page, but with the message that the cart items have change.
Thanks!
Ah okay, that makes sense!
Discussed in https://github.com/duncanmcclean/simple-commerce/discussions/841
Solution
Simple Commerce should be checking the stock of products in the cart before redirecting the user to off-site gateways.
This won't be an issue if you're using an on-site gateway because the stock is checked before collecting payment.