Out of Stock Items

  • Posts: 530
  • Thank you received: 9
  • Hikashop Business
1 day 23 hours ago #368332

-- HikaShop version -- : 6.2
-- Joomla version -- : 5.2
-- PHP version -- : 8.2.29
-- Browser(s) name and version -- : Googlr Chrome

Hi, I appears to have found an error.

Sometimes the customers payment fails. They come back to pay using the same order, but, an item that has gone out of stock during the time taken to pay is still processed? surely if the product stock level is then 0 it should not allow this?

Rgds

Please Log in or Create an account to join the conversation.

  • Posts: 84290
  • Thank you received: 13692
  • MODERATOR
1 day 19 hours ago #368333

Hi,

The stock check is done during the add to cart, the checkout, and when the order is created.
If the "Update stock when order is" setting of the HikaShop configuration is set to "confirmed", then the stock won't be reserved until the order is paid. So, this case can happen and we cant do anything about it in HikaShop. Suppose you have 2 users with the same product in the cart with a stock of 1. Both create their order and are redirected to the payment gateway at roughly the same time. Since you want the stock to be updated only after the payment, it is normal that this is allowed.
Once one user pays for his order on the payment gateway, his order is confirmed and the stock goes to 0. However, the other user is already on the payment gateway. And thus there is no way for HikaShop to prevent him from finishing his payment.

However, if you set the setting to "created", then the stock is reserved when the order is created, before the payment. And so this case can't happen. Once one user creates an order, the stock will be decremented, and if it goes to 0, then no other user will be able to create an order.
In such case however, you want to configure the HikaShop order auto cancel plugin so that created orders that have not been paid are automatically cancelled after a while in order to liberate the stock.

Please Log in or Create an account to join the conversation.

Time to create page: 0.045 seconds
Powered by Kunena Forum