How to print a list of all products from Magento?

Is there a way to print all products and their categories in Magento, or is there a way to easily call all this information from db in a user script?

+4
source share
1 answer

Get all products:

$products = Mage::getModel('catalog/product')->getCollection() ->addAttributeToSelect('sku') ->addAttributeToSelect('name'); foreach($products as $product){ echo 'Name:'.$product->name.' sky:'.$product->sku.'<br>'; } 

You can add as many attributes as you want with addAttributeToSelect('attribute_name')

+2
source

Source: https://habr.com/ru/post/1416322/


All Articles