4

In Magento 1 you were able to add a product filter to a Stock Item collection in the Mage_CatalogInventory_Model_Resource_Stock_Item_Collection class. This functionality appears to be missing along with the other methods included in the Magento 1 class.

Additionally, it appears that you cannot addFieldToFilter to a Stock Item collection due to the models that it extends (i.e.

Magento\Framework\Data\AbstractSearchResult

is extended as opposed to something like the Product Collection of which extends:

Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection)

So my question is, how are you supposed to add a product filter to a stock item collection on Magento 2 (And indeed if it's possible).

Any help is appreciated!

1
  • I'm typing down same question, do you have any way by now?
    – Lan Nguyen
    Jun 7, 2019 at 10:13

0

Your Answer

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

Browse other questions tagged or ask your own question.