开发者

Magento Category Filter Error

开发者 https://www.devze.com 2023-03-17 08:22 出处:网络
$category = Mage::getModel(\'catalog/category\')->load($currentCategory->getId()); $_productCollection = $category->getProductCollection()->addFieldToFilter(\'genre\', array(\'finset\' =&
$category = Mage::getModel('catalog/category')->load($currentCategory->getId());

$_productCollection = $category->getProductCollection()->addFieldToFilter('genre', array('finset' => '126'))->addAttributeToFilter('category_ids',array('finset'=>'14'));

Mage::getModel('catalog/layer')->prepareProductColle开发者_运维技巧ction($_productCollection);
$_productCollection = $_productCollection->load();

The above statement is giving an error, please help me run this.


What are you trying to do exactly?

If you call $category->getProductCollection, you will only get the products in the category you loaded so no need for a category filter. I think for Magento above 1.4, category_ids doesn't exist anymore.

0

精彩评论

暂无评论...
验证码 换一张
取 消