Post by JoshuaLMG » Mon Aug 17, 2015 6:35 pm

Two customers where able to buy the same product which quantity was set to 1.

Steps to reproduce:
1. Set "Stock Checkout" to "No".
2. Change the quantity of a product to 1.
3. Open 2 browsers (eg. Safari and Chrome).
4. Add the product of which there is only 1 in stock in both browsers to your cart.
5. Go trough the checkout procedure in 1 browser (browser A) till the last step.
6. Go trough the checkout procedure in the other browser (browser B) and finish it.
7. Finish the checkout procedure in browser A.

Now it turns out that the product is ordered 2 times, the quantity of the product is also now -1 rather than 0.
Browser A in this case would have to get an out-of-stock message when trying to finish the order but this doesn't happen.
I tried to fix this issue myself by adding a out-of-stock check in the checkout/success controller but this didn't work and gave an out-of-stock message for both browsers thus unable to order the product.

Newbie

Posts

Joined
Mon Aug 17, 2015 6:31 pm

Post by imdevlper18 » Tue Aug 18, 2015 10:00 pm

Nice debugging.

See once you move to the last step, the order has already been created but the stock value is not yet decreased.

So once order is completed for one. If you want to stop for other. you need to add a condition or function to check the stock on confirm payment page rather then success.

If you need help with this feel free to contact us support@cartbinder.com
Or skype us at: cartbinder

Opencart Extensions | Professional opencart support | Support Ticket | support@cartbinder.com


User avatar
Active Member

Posts

Joined
Sun May 11, 2014 2:04 pm
Who is online

Users browsing this forum: No registered users and 8 guests