Curiologix
Curiologix

Reputation: 83

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')->prepareProductCollection($_productCollection);
$_productCollection = $_productCollection->load();

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

Upvotes: 0

Views: 334

Answers (1)

Fran
Fran

Reputation: 670

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.

Upvotes: 1

Related Questions