开发者

Display New Products, Filter by Category Ids: in Magento

i have magento 1.5 and i want to display new products Filter by Category Ids. I had try by ->addCategoryFilter($categoryId); But not working...

I also try this tips, which exactly i want by (Category ids). but it give me 开发者_JS百科error of: "Invalid attribute Category_ids"...

SO can any one display new products in magento by list of Category ids....?


See my reply here How to get all product from a category including its subcategories in Magento?


To filter with Category you need to pass category model data rather then category ID. As like below.

$category_id = 10;
$catagory_model = Mage::getModel('catalog/category')->load($category_id);
$collection->addCategoryFilter($catagory_model);

Please see this link for more detail http://way2discuss.blogspot.in/2012/07/magento-show-all-products-from-specific.html

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜