且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

按类别划分的 Magento 产品

更新时间:2021-08-21 23:45:15

您可以使用 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);