I am trying to fetch the product collection in Magento 2
which return the all products including
-> with all instock and out of stock products
-> with all Visibility (Not Visible Individually,Catalog,Search,Catalog, Search)
-> with all status (Enabled,Disabled)
Is it possible to get this type of product collection?
Best Answer
Using bellow code, you fetch the product which is currently enable.
NOTE You need to change
getProductCollection()
function code for your other requirement.