Filtering by category in Magento 1.4

Posted by Sam on Stack Overflow See other posts from Stack Overflow or by Sam
Published on 2010-03-24T21:54:03Z Indexed on 2010/03/24 23:23 UTC
Read the original article Hit count: 373

Filed under:

Hi All

I have a custom module I made to show featured products on the homepage. I set it up to show products that are in a ‘featured’ category. It works fine in 1.3, but now in 1.4 I get the following error:

SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘e.category_ids’ in ‘where clause’

Here’s my code:

$_productCollection = Mage::getResourceModel('reports/product_collection')
    ->addAttributeToSelect('*')
    ->addAttributeToFilter('visibility', $visibility)
    ->addAttributeToFilter('category_ids',array('finset'=>$featuredcategory))
    $_productCollection->load();

The featured category is specified from the admin.

Anyone any ideas what might be up?

© Stack Overflow or respective owner

Related posts about magento