1
我必须加载来自特定属性集合值的所有可用产品,此外,它只需要过滤不属于特定类别/类别的产品。我如何在这里加载产品集合。请帮我如何在magento中加载不属于特定类别的产品
我必须加载来自特定属性集合值的所有可用产品,此外,它只需要过滤不属于特定类别/类别的产品。我如何在这里加载产品集合。请帮我如何在magento中加载不属于特定类别的产品
<?php
$storeId = Mage::app()->getStore()->getId();
$catalog = $this->getLayout()->createBlock('catalog/product_list')->setStoreId($storeId);
$collection = $catalog->getProductCollection()->addAttributeToSelect('*');
$collection->getSelect()->where(category_id != { cat_id })->limit($this->products_count);
$_productCollection = $collection;
?>
这还不是teste,我不确定category_id是否是在数据库中使用的正确值。但它应该给你一个好的开始。