Hello,
It’s likely you have a conflict with another plugin or your theme. What other plugins are you using?
Thread Starter
rikah
(@rikah)
I suppose this one could be messing this up: WooCommerce Auto Restore Stock
But I have so many stuff installed that it’s embarrassing:
– Advanced Order Export For WooCommerce
– Brazilian Market on WooCommerce
– Checkout Field Editor for WooCommerce
– Claudio Sanches – PagSeguro for WooCommerce
– Code Snippets
– Contact Form 7
– Envato Market
– Kadence WooCommerce Email Designer
– Kirki Customizer Framework
– Loco Translate
– MC4WP: Mailchimp for WordPress
– Melhor Envio v2
– Mercado Pago payments for WooCommerce
– Meta Box
– Really Simple SSL
– Sober Addons
– Soo Demo Importer
– Soo Product Filter
– Soo Wishlist
– Ultimate Auction For WooCommerce
– UpdraftPlus – Backup/Restore
– Variation Swatches for WooCommerce
– Wordfence Security
– WP Fastest Cache
– WP Mail SMTP
My theme is “sober”, some of these plugins are from it.
Sorry for the delay, I’m currently out of town on vacation. When I get back I’ll have to do some testing to see if I can reproduce that issue.
What type of products are you using? (Simple/variable/etc?) Presumably variable because you are using the swatches plugin
Are they single quantity items?
Using AJAX add to cart?
I looked through the ‘WooCommerce Auto Restore Stock’ plugin and it only has hooks to do something when the order status changes. Based on your description it doesn’t sound like this problem is happening when an order is placed but when a user goes to the checkout page and back to the cart.
I tried to reproduce the issue but am unable, can you provide additional information?
I don’t have access to your theme’s code so there isn’t any way I can test against that, if you send me a copy I can take a look.
Thread Starter
rikah
(@rikah)
Hello, James! That’s understandable, thanks for replying and testing.
Cart Stock Reducer is currently inactivated but the problem remains, so maybe it isn’t the culprit after all…? Anyway, answering your questions:
The majority (90%) of the products are simple and there’s only 1 unit of each since it’s a second hand shop.
No ajax that I know of.
I’m also unable to reproduce the issue, but my clients keep on facing this bug…
If you think it can be related to the plugin, please let me know how to send the theme’s code.
Thank you!
If the plugin is disabled then the issue certainly is not related to it, the plugin does not make any changes to the database at all.
Thread Starter
rikah
(@rikah)
Understood, thanks for the support. I’m still searching for what’s causing it.
Thread Starter
rikah
(@rikah)
Hi, James! I just wanted to leave some updates concerning this issue: I contacted the payment plugin developer (mercado pago, it’s brazilian) and they ran some tests and couldn’t find any issues on their end.
I discovered why I couldn’t replicate the issue everytime: the error occurs ONLY when using the “back” button of the browser. If the person clicks on the “back” hyperlink from the plugin checkout, that doesn’t occur.
When the user returns from the checkout page using the back browser button, the order duplicates itself. That’s whey they can’t order anymore and the stock goes to 0, because there’s 2 of them.
If I disable your plugin, that doesn’t happen anymore, is this a conflit between your plugin and the payment plugin?
Can you give me some screenshots of the process? Even if the back button is used the code should still check if there are valid items before adding additional to the cart.
Thread Starter
rikah
(@rikah)
Actually I’ve got a video: https://we.tl/t-bZi4Ib0WlE
What’s the exact error message that is displayed at the end? I can’t tell in the video.
Can you check what status the order is in when you do this? I suspect the Mercado payment plugin is doing things a bit differently than other payment processor plugins.
I spent a bit poking around in the Mercado plugin and notice they have a ‘Reduce inventory’ setting that claims ‘Activates inventory reduction during the creation of an order, whether or not the final payment is credited. Disable this option to reduce it only when payments are approved.’
What do you have this set to?