How do I filter a magento collection by a select drop-down attribute?
问题 In magento, I have an attribute called cl_designer, which is a select drop-down option. I want to filter the products collection on it, like this: $collection = Mage::getModel('catalog/product')->getCollection(); $collection->addAttributeToFilter('cl_designer', array('like' => $filter)); But it doesn't work! When I print out the query with $collection->getselect(), I see that it is comparing $filter to catalog_product_entity_int.value. But this is wrong, because for select options, catalog