Sync causing Zero Stock
-
When square sends zero stock, plug in changes backorders allowed to zero stock and customers can not purchase.
How to fix this? It was working last week now it is not and losing sales
-
Hi there!
Thanks for reaching out!I understand how important this is, especially when it impacts your sales.
To help us investigate further, could you please confirm if any changes were made on your site around the time this issue started — such as plugin updates, changes to product settings, or adjustments to your Square account?
Also, are you using the WooCommerce Pre-Orders plugin (https://woocommerce.com/products/woocommerce-pre-orders/)
Lastly, please share a screenshot of your Inventory Sync settings under WooCommerce → Settings → Square. This will help us better understand how your inventory is syncing between Square and WooCommerce
In the meantime, I’d like to understand your site properly. Could you please share the System Status Report which you can find via WooCommerce > Status
Please use https://pastebin.com/ or https://gist.github.com/ and share a link to that paste in reply here. Once we have more information, we’ll be able to assist you further.Hi.
Not sure about any changes, a third party handles that.
I don’t believe I’m using pre-orders plugin
They found a line in the plugin:
update_post_meta( $variation_id, ‘_backorders’, ‘no’ );
They have changed it to:
update_post_meta( $variation_id, ‘_backorders’, ‘notify’ );
I was told that editing the plugin file is not recommended because once the plugin is updated, it will revert to its default. They asked me to reach out here and ask for a code snippet for a proper and permanent fix.
Does that make sense to you?Hello smokinjefe,
Thank you for your reply.
Could you please let me know who advised you to edit the plugin files and modify the code?
It is not recommended to edit plugin files.Also, could you share your site’s System Status Report? You can upload it to https://pastebin.com and share the link here. This will help me better understand the situation and assist you more effectively.
Looking forward to your response. 🙂
https://pastebin.com/peteetai p/w: VeQ4AC9323
Hi @smokinjefe ,
Thanks so much for getting back to us and for sharing that info.
Not sure about any changes, a third party handles that.
I was told that editing the plugin file is not recommended because once the plugin is updated, it will revert to its default. They asked me to reach out here and ask for a code snippet for a proper and permanent fix.That definitely makes sense — editing plugin files directly can cause issues down the road, especially after updates. We’d love to help with a more permanent solution.
Could you share a bit more about your setup? For example, is your inventory being managed through a specific plugin, or possibly by that third party you mentioned? Also, do you happen to know who asked you to add the line of code to the plugin file? Was it a developer or maybe someone from your hosting or plugin support team?
Once we have a little more detail, we’ll be in a much better spot to suggest a safe and lasting fix for you.
Looking forward to your reply!
Hi guys.
I enter stock into square, your plugin syncs square and my website.
It’s been working fine for as long as I can remember until recently. Sales dropped off and a couple customers emailed asking when stock would be back in stock so they could order.
That prompted me to look into it as customers should always be able to buy and I saw that stock was set to zero instead of backorder.
I changed it to backorder and waited for the sync to happen which saw the backorder changed to zero.
I contacted Square who said it’s a WordPress issue.
I reached out to my hosting team who basically did the same thing and didn’t understand why it was changing back to zero.
I believe one of them had a look at the code and changed it. Since the change it has been working, but he said I need a permanent fix.Hi @smokinjefe,
Thanks for the detailed explanation, I can see how frustrating this must have been!
Since you mentioned that your hosting team made a code change that resolved the issue temporarily, could you share the exact details of what was changed? That might help us better understand what’s causing the sync to override the backorder setting and guide you toward a more permanent fix.
Looking forward to your reply!
That was explained in the 2nd post.
update_post_meta( $variation_id, ‘_backorders’, ‘no’ );
Changed to below
update_post_meta( $variation_id, ‘_backorders’, ‘notify’ );
Hi @smokinjefe,
Thank you for taking the time to explain things in detail — that really helps us better understand the situation.
Based on what you’ve shared, it looks like the main issue is that when products sync from Square to WooCommerce, any product with a stock quantity of 0 is automatically set to not allow backorders. This would explain the drop in sales and why customers are reaching out about out-of-stock items.
Just to clarify, Square doesn’t manage the backorder setting — it only handles stock levels. The backorder status (_backorders) is something WooCommerce controls. So what’s likely happening is:
- Your product stock in Square is set to 0.
- When the sync occurs, WooCommerce updates the product stock accordingly.
- WooCommerce then disables backorders (sets it to ‘no’), which is the default unless overridden.
You’re absolutely right that directly editing the plugin isn’t advisable, as any updates will overwrite your changes.
Since you mentioned it used to work fine before — “It’s been working fine for as long as I can remember until recently” — let’s try rolling back the plugin to a previous versions.
I recommend installing the WP Rollback plugin and using it to revert WooCommerce Square to a version or two earlier. This can help us confirm whether a recent update might be the cause.
Let me know how it goes after testing with an earlier version!
Hi there,
As there’s been no follow-up, I’ll consider this resolved for the time being. We’re happy to jump back in if anything comes up!
Apart from this, if you’re happy with our plugin and the support you’ve received, we’d really appreciate a review: https://ww.wp.xz.cn/support/plugin/woocommerce-square/reviews/#new-post
The topic ‘Sync causing Zero Stock’ is closed to new replies.