Please help us to make AbanteCart Ideal Open Source Ecommerce Solution for everyone.

Support AbanteCart eCommerce

Author Topic: Product count goes negative on two persons trying to checkout at sametime.  (Read 479 times)

Offline susinthiran

  • Newbie
  • *
  • Posts: 14
  • Karma: +3/-0
    • View Profile
Hi,

I just want to get suggestion on following problem.

Assume if two user having same product in their cart and the product is having a count of 1.
If both users clicks confirms button the order gets placed but the product count goes to negative.

Any suggestions to avoid this?

Thanks in advance.

Offline eCommerce Core

  • Administrator
  • Hero Member
  • *****
  • Posts: 1596
  • Karma: +92/-1
    • View Profile
By default AbanteCart does not limit customers to place orders in this situation. This is not a easy solution.

If stock restriction is very critical for the business, there are some solutions:

1. it is possible to implement stock check validation during confirmation stage.

There are some considerations to make here.
Should system prevent payment in such situation or allow payment and than check for stock.

Placing validation before payment will not solve problem entirely as second customer might be still typing payment details and the other one already completed.
Payment for one customer might fail and you refuse the second customer of good sale.

If stock validation is done after the successful payment, than payment must support auto refund in event customer is not allowed to place an order.

Keep in mind that customer might have multiple items in the cart and that can cause loss of sale for good products.

2. Some companies implement time lock for stock and release it back if no purchase happened.
Customer will be advised that they have N minutes to checkout.
If this case stock is locked (deducted) during adding to cart process.

You will need to create a backend process to release items to stock.

We are aware of this and considering if we implement one of the solutions in v2.0.





“If you’re in the luckiest one per cent of humanity, you owe it to the rest of humanity to think about the other 99 per cent.”
― Warren Buffett

Offline susinthiran

  • Newbie
  • *
  • Posts: 14
  • Karma: +3/-0
    • View Profile
Hi,

Thank you!

I have implemented stock validation as you did in cart page before confirming order when user opts for cash on delivery!.

I think this is far better way to avoid product count getting negative.However I will lose second customer ofcourse.

In case of payment gateway I am analysing ways to implement validation.

Implementing lock for stock while adding to cart needs some analysis and I will definitely look at it.

Thanks for your suggestion and I am glad to know that solution will be available in version 2.