2

I was using StockStateInterface to get stock qty, it was working fine in development and staging server but was not working in production server.

Then I used StockRegistryInterface to get the result and it worked on the production server.

Why it happened so?

I used this:

\Magento\CatalogInventory\Api\StockStateInterface $stockState, 
\Magento\CatalogInventory\Api\StockRegistryInterface $stockRegistry,

Your Answer

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

Browse other questions tagged or ask your own question.