开发者

Magento Category Filter Error

$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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜