-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to handle already sold products which are still in the cart? #842
Comments
* Split up checkout pipeline There's some stuff we need to do before the payment and there's other stuff we need to do after the payment has happened. * Add a full stop * Remove old import * Split up tests * Adjust CheckoutController tests The stock events are only dispatched when updating the stock count on the product. So if it doesn't get that far (for example, if it fails stock validation), then the events won't be dispatched because nothing's actually changed. * Do checkout validation just before payment * Don't listen specially for stock exception Instead have the stock exception extend the PreventCheckout exception. * wip * Ensure #842 has been fixed
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. |
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 Then on that page, if you do 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. {{ if {sc:cart:count} === 0 }} Since the cart is emptied the user is automatically redirected to the (wrong) cart. Thanks! |
Ah okay, that makes sense! |
Discussed in #841
Originally posted by itsmesaskovic March 3, 2023
We are selling used books via our Simple Commerce setup.
Now we have had an issue where a user placed an order, paid for it, but it never got flagged as paid.
Looking back in the logs, I found out that the cart was filled with a number of books for the February 10 date. However, on February 10, another visitor also added some of the selected books to the cart and fulfilled the order.
Because they were already in our first customers shopping cart, they could place an order with these books on February 22. However, upon confirmation, the order could not be processed automatically, as the books were already out of stock.
What would the best practice be to handle this before order submission / payment?
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.
The text was updated successfully, but these errors were encountered: