0

I am using magento 2.4.1, the issue is randomly my product's quantity is increasing, it automatically increments the quantity after some time. I tried to keep eye on few products and found that each products increment was different. I checked in logs also but none were generated.

i check somewhere and found that "sales_clean_orders" cron is the reason behind this. but even after disable the cron my product quantity is still increasing.

does anyone know what exactly "sales_clean_orders" cron do to product quantity?

2 Answers 2

1

Cron sales_clean_orders - Cleans Expired Orders

First Run these CLI Commands

php bin/magento indexer:reset

indexer:reindex

Then Keep an Check If Product Qty Increases.

If Yes - Can you see any canceled orders with those products? As an Quick Fix (Which is Never Recommended), You can comment out the cron listed in

vendor/magento/module-sales/etc/crontab.xml

Run

php bin/magento cron:remove

php bin/magento cron:install -f

In the mean time keep checking, If you are using any Custom Payment Method & had an Observer

  1. order_cancel_after
  2. sales_order_save_after
  3. sales_order_state_change_before

May be there is some buggy code there.

Check the screenshot for more details

enter image description here

0

See here, at our site it had to do with discount rules:

https://github.com/magento/magento2/issues/16779

The sales_clean_orders cron could not cancel the order and tries it each hour. But it actually does increase the stock level each time it tries...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.