• If stock quantity is 1, and if 2 or more people click on buy now at the same second, it shows an error for both and both can’t purchase it even though 1 is still in stock.

    Instead is it possible to further filter the stock at checkout? On clicking checkout button it becomes out of stock for 1 so that the person who clicks checkout first is able to buy?

    Or any other way to fix the issue?

    Theme – Rey
    WordPress Version – Latest
    Woocommerce version – Latest
    Hosting – AWS Lightsail 4GB RAM
    Server – Ngnix

    Other than that, the plugin seems to work very well!

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author James Golovich

    (@jamesgol)

    Can you screenshot the plugin settings? It sounds like it’s not working right, even if they click at the exact same time the first one gets the item.

    Thread Starter hrithikkaul

    (@hrithikkaul)

    Hi, thanks for your reply.

    Here’s the screenshot link – https://ibb.co/7RpBH51

    You can try adding this product to cart from 2 devices at once and see what happens – https://suenosouvenir.in/product/nachos-miniature-copy/ (Stock is currently 1 only)

    Thanks.

    Plugin Author James Golovich

    (@jamesgol)

    Do you have some kind of page caching? When I first visited it said 3 in stock, I added 1 to a cart, opened page in another browser and it showed 3. Removed all items from cart and reloaded and now it shows 2 in stock. In a 3rd browser it showed 3 in stock, added 1 to cart and it showed 1 in stock.

    Thread Starter hrithikkaul

    (@hrithikkaul)

    Hi, I have now disabled server level caching. Didn’t have any plugin though. Stock quantity is updated to 1. Had changed it to 3 by mistake.

    You may now please try to add to cart from 2 devices at once and see the issue.

    Plugin Author James Golovich

    (@jamesgol)

    Sorry, I can’t reproduce it on your site. I always get one with it being added to the cart and the other gets a notice “Item is no longer available” and the stock text says “THIS ITEM IS NOT AVAILABLE AT THIS TIME DUE TO PENDING ORDERS. CHECK BACK IN 3 MINS TO SEE IF ITEMS BECOME AVAILABLE”

    Thread Starter hrithikkaul

    (@hrithikkaul)

    Thanks for your time to look into the issue. The plugin works perfect when there’s a difference of 1s and more.

    However, not when the button is clicked at the exact same second. Have you tried clicking ATC on the same second from 2 devices?

    Once again, appriciate the responses you are giving ??

    Plugin Author James Golovich

    (@jamesgol)

    Yes, I setup a timer to run the request at the exact same millisecond and it looks like it works as expected. One session gets the item, the other does not and gets the ‘Item is no longer available’ message

    Plugin Author James Golovich

    (@jamesgol)

    With numerous tries I was able to duplicate the issue. I’ll see if I can replicate it locally.

    Thread Starter hrithikkaul

    (@hrithikkaul)

    Sure, thanks. Please let me know. Could a reason be that since the server is in India, and we being in India both requests are hitting the server at once, but since you will be far away from server location due to latency a slight difference in time of the 2 hits happens every time for you?

    Plugin Author James Golovich

    (@jamesgol)

    I’m going to have to keep working on this. This didn’t used to be a problem when the plugin would query the carts/sessions right before deciding it was available but WooCommerce changed so they only write out sessions at the end of a transaction (on the ‘shutdown’ hook). So on a slower/busier server the window for this to happen is larger. I’ll see if I can shrink the window even more, I have a few ideas but it will require some testing.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Out of stock for everyone’ is closed to new replies.