Magento 1.4 Load By Category Not Working
Posted
by LinuxGnut
on Stack Overflow
See other posts from Stack Overflow
or by LinuxGnut
Published on 2010-04-20T18:57:03Z
Indexed on
2010/04/20
19:23 UTC
Read the original article
Hit count: 221
Hi folks. I have a Magento helper class I wrote that works wonderfully in 1.3. However, we're working on a new install of 1.4 and filtering by category won't work for some reason.
function __construct() { Mage::app(); $this->model = Mage::getModel('catalog/product'); $this->collection = $this->model->getCollection(); $this->collection->addAttributeToFilter('status', 1);//enabled $this->collection->addAttributeToSelect('*'); } function filterByCategoryID($catID) { $this->collection->addCategoryFilter(Mage::getModel('catalog/category')->load($catID)); }
I can't figure out why this isn't working in 1.4. Has anyone else come into this issue?
© Stack Overflow or respective owner