Out of Stock Item Sold
-
An order was placed on 3 days ago and the order succeeded. The order notes say “Stock levels reduced: <product name> 1 -> 0”.
Today, 2 more orders were placed by the same person on the same product. 1 failed due to a general decline another went through. The order that succeeded has the same order note: “Stock levels reduced: <product name> 1 -> 0”.
The product Inventory tab has:
- The Stock Management checkbox checked
- Do not allow for backorders
- quantity is now 0.
The global Product Inventory settings also have
- Enable stock management checked.
- blank for Hold stock
I’m looking for any ideas on how this can happen.
-
Hello @webheadllc what is your backorder set to? Sorry, just realized after I clicked submit you added it.
Can you do a systems report please and post that here.
Go to WooCommerce > Status > Get Systems Report and pasting that here inside using a Code Block.
-
This reply was modified 8 months ago by
Stef.
Hi @serafinnyc, thanks for the reply. I’m not that comfortable sharing the full system report. let me know what you need to see. Here’s the active woocommerce related plugins.
WC Version: 9.1.2
Legacy REST API Package Version: ? 1.0.4
Action Scheduler Version: ? 3.7.4
Log Directory Writable: ?
WP Version: ? 6.5.5 - There is a newer version of WordPress available (6.6.1)
WP Multisite: –
WP Memory Limit: 512 MB
WP Debug Mode: –
WP Cron: ?
Language: en_US
External object cache: ?
### Active Plugins (43) ###
WooCommerce.com Update Manager: by Automattic – 1.0.3
Google Analytics for WooCommerce: by WooCommerce – 2.1.5
WooCommerce Legacy REST API: by WooCommerce – 1.0.4
WooCommerce Only When Needed: by Webhead LLC – 0.1
WooCommerce Google Product Feed: by Ademti Software Ltd. – 11.0.9 (update to version 11.0.11 is available)
WooCommerce Square: by WooCommerce – 4.7.1
WooCommerce Table Rate Shipping: by Bolder Elements – 4.3.11
WooCommerce: by Automattic – 9.1.2Hey there, @webheadllc! Thanks for contacting us. I’m happy to help you.
Thank you for the information!
Since it is not included in the SSR you shared, can you please confirm if the database version of your website is matching the WooCommerce version? If there’s a mismatch it can cause a lot of issues.
The product Inventory tab has:
- The Stock Management checkbox checked
- Do not allow for backorders
- quantity is now 0.
If you go to the product page on your website right now, does it show out of stock?
Are you able to try and run a test order on it to check if you are able to replicate the issue?
Can you please share the Fatal error logs (if any) under WooCommerce > Status > Logs. Then you can use the selector to search for Fatal Errors on the date of the purchase.
You could copy and paste your reply here or paste it via https://gist.github.com/ and send the link here.Looking forward to your reply.
Have a wonderful day!
Hi @carolm29 ,
Yes, the database version matches the WooCommerce version:
WC Database Version: 9.1.2
The product page shows the item is out of stock. If you can give me some code to run to try to checkout with, I’ll be happy to run a test order.
There’s no logs of fatal errors that happened on the days of the purchase.
The Square plugin has some logging and shows a bunch of Notices. They seem to happen randomly about one or two per hour. It’s usually a different product each time and has been happening for over a month.
2024-07-23T00:03:36+00:00 Notice Error: You cannot add that amount of <product name>; to the cart because there is not enough stock (0 remaining).
Additional context
{
"_legacy": true
}Hello @webheadllc there’s absolutely no security issue here by pasting the entire SSR. You can remove the link / domain and db prefix etc. but don’t remove anything else. I promise this is safe. We do this everyday.
We need to see the apps you have added to see if there’s anything that stands out as a possible culprit.
Hi @webheadllc
The Square plugin has some logging and shows a bunch of Notices. They seem to happen randomly about one or two per hour. It’s usually a different product each time and has been happening for over a month.
Did you install and activate the WooCommerce Square plugin? Could you please share your sync settings? Have you set it to Square or WooCommerce?
Because, from what you’ve explained, there might be a conflict between the stock management settings in WooCommerce and the Square plugin. The error message from the Square plugin suggests it’s trying to add stock to the cart (Square POS) when none is available.
For better assistance, can you provide screenshots showing the Square setting on your end? For screenshots, I recommend https://snipboard.io/ for easily sharing screenshots – please follow the instructions on the page, then paste the URL(s) in your reply.
In the meantime, you can run a conflict test to help you identify the cause of the issue. More info: https://woocommerce.com/document/how-to-test-for-conflicts/
Looking forward to hearing from you!
Thanks for all the quick replies!
For the system report, I’ll need to go through it and remove all the site-identifying lines like in custom plugins, themes, categories, etc. I’m not sure if it’s worth doing. I can send you parts that you need or you can let me know what to look for.
I’m using the Woocommerce Square plugin as listed above in the partial system report. Syncing is disabled: https://snipboard.io/93UyV6.jpg
I don’t think conflict testing will work as I can’t reproduce the issue. This is the first and only time this issue has occurred. I’m beginning to think it was a user error where someone maybe updated the wrong product.
Since the orders happened a few days apart, and there’s no known way to purchase a 0 inventory item, then the stock levels must have been set to 1 at some point between the first and second order right? I’m thinking of adding logging in the hooks below to print out the stack trace. I’ll probably just log it when inventory gets updated to anything > 0.
woocommerce_product_set_stock
woocommerce_variation_set_stockHi @webheadllc,
I’m using the Woocommerce Square plugin as listed above in the partial system report. Syncing is disabled: https://snipboard.io/93UyV6.jpg
Since the sync is disabled, that rules out the stock being synced and marked as available (1 available) from Square.
Just to be sure, looping back to the first message:
An order was placed on 3 days ago and the order succeeded. The order notes say “Stock levels reduced: <product name> 1 -> 0”.
This order was fully processed and marked as completed, correct? No chance of this one being canceled and returning the stock back to 1? It’s interesting since it’s the same customer purchasing the same product three days later.
I don’t think conflict testing will work as I can’t reproduce the issue. This is the first and only time this issue has occurred. I’m beginning to think it was a user error where someone maybe updated the wrong product.
It is also possible that this was a human mistake, updating the stock for the wrong product, yes.
Furthermore, considering this has been a single occurrence on your site so far (we haven’t gotten any other reports about such an issue from other users either), it’d point to a change being made manually.
I’m thinking of adding logging in the hooks below to print out the stack trace. I’ll probably just log it when inventory gets updated to anything > 0.
Installing a logging/history plugin or code snippet would help if you have more people working on your team or even if it’s just you. Sometimes, we simply make mistakes!
Please keep us posted if this happens again so we can learn more.
Thanks!
-OPAll orders were processed at the time and only had order notes of the “1 -> 0”. When the 2nd/3rd orders happened and processed, the first order still had a Processing status.
This site has had a lot of fraudulent purchases so it was worrisome when something like this happens. I’m glad to hear there aren’t any other reports similar to this.
I’ll setup some logging and report back if it finds anything.
Thank you all for the quick and responsive support!
Hey, @webheadllc!
We are happy to help!
Please let us know if there’s anything else we can do to help or if you have any questions.
Have a wonderful day!
-
This reply was modified 8 months ago by
- The topic ‘Out of Stock Item Sold’ is closed to new replies.