If we want to load all the products under one category we need to use below code is the simplest way,
$cat_id = 5;
$collection = Mage::getModel("catalog/product")->getCollection();
$_category = Mage::getModel("catalog/category")->load($cat_id);
$collection->addCategoryFilter($_category);
No comments:
Post a Comment