0

I don't want to decrease stock qty when order is placed. I know this can be done in admin by setting decrease stock to NO. But I want to change the update stock logic, so I need to know where can I programmatically stop decreasing stock qty in code.

0

By programmatically, set an observer to retain the quantity after placing the order success. Refer this link to use observer Which observer to use after success order on Magento 2?

Edit

vendor/magento/module-catalog-inventory/Observer/SubtractQuoteInventoryObserver.php

Refer this file, It has the functionality to decrease quantity.

  • I tried "checkout_submit_all_after". but I can't see which function does Magento 2 use to decrease the stock qty. – Magento Learner Dec 13 '18 at 13:33
  • See my edit @MagentoLearner – Vignesh Bala Dec 13 '18 at 13:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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