Category Product Collection

Posted Almost 12 years ago. Visible to the public.

This snippet provides a collection of products within a category

$cat = Mage::getModel('catalog/category')->load(1);

$coll = Mage::getResourceModel('catalog/product_collection');
$coll->addCategoryFilter($cat);

Mike Whitby
Last edit
Over 10 years ago
Posted by Mike Whitby to Magento (2012-04-23 11:09)