按类别划分的 Magento 产品

2021-12-19 00:00:00 categories product php magento catalog

有谁知道我如何从 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);

相关文章