I need to check the Product Salable Quantity of a product after a successful order to change one of the product´s attributes.
I keep getting the product salable quantity before It´s decremented. Where can I insert my code?
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.Sign up to join this community
I think you need to use Controller fired after proper event.
Event can be fired before:
Interesting explanation what is Magento Quote. https://stackoverflow.com/questions/4612100/what-is-a-magento-quote
List of events:
I am not sure about the Magento 2.3.X.
but for 2.2.X and 2.1.X versions, Stock deduction happen on order place from
The method registerProductsSale of
Magento\CatalogInventory\Model\StockManagementis responsiable for stock deduction.
This method is called from
Magento\CatalogInventory\Observer\SubtractQuoteInventoryObserver observer on
Magento\CatalogInventory\Observer\CheckoutAllSubmitAfterObserver observer on
For your requirement, you have to work on these two observer classes.