0
我尝试过不同的论坛,并找到以下代码对我有帮助,但它不会为我返回任何内容。Magento:来自某个特定类别的产品收集及其子类别
$limit = ($limit == 0) ? 50 : $limit;
$category = Mage::getModel('catalog/category')->load($cat_id);
$category->setIsAnchor(1);
$products = Mage::getResourceModel('catalog/product_collection')
->addAttributeToSelect('*')
->addAttributeToFilter("status", array("eq" => 1))
->addAttributeToFilter("visibility", array("eq" => 1))
->setPageSize($limit)
->addCategoryFilter($category)
->load();
$products
始终为零长度。