$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.
精彩评论