本文介绍了Magento产品分类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有人知道我如何从 Magento 中的视图文件中获取属于特定类别的产品列表. a>?
Does anyone know how I can get a list of products belonging to a specific category from within a view file in Magento?
推荐答案您可以使用magento对象进行过滤.
You can use magento object to filter.
示例:
$categoryId = 123; // a category id that you can get from admin $category = Mage::getModel('catalog/category')->load($categoryId); $products = Mage::getModel('catalog/product') ->getCollection() ->addCategoryFilter($category) ->load(); print_r($products);更多推荐
Magento产品分类
发布评论