cancel
Showing results for 
Search instead for 
Did you mean: 

Magento 2 list of all products in external script?

Magento 2 list of all products in external script?

In magento 1 I was able to list all products in an external php script with the following:

 

require_once"$rootpath/app/Mage.php";
umask(0);
Mage::app('default');


$products = Mage::getModel('catalog/product')->getCollection();
$products->addAttributeToFilter('status', 1);
$products->addAttributeToFilter('visibility', 4);
$products->addStoreFilter($storeId);
$products->addAttributeToSelect('*');
$products->load();

 

Can anyone tell me how to do this in mag 2?