在magento中,我有一个名为cl_designer的属性,它是一个选择下拉选项.我想在其上过滤产品系列,如下所示:
$collection = Mage::getModel('catalog/product')->getCollection();
$collection->addAttributeToFilter('cl_designer', array('like' => $filter));
Run Code Online (Sandbox Code Playgroud)
但它不起作用!当我使用$ collection-> getselect()打印出查询时,我发现它正在将$ filter与catalog_product_entity_int.value进行比较.但这是错误的,因为对于select选项,catalog_product_entity_int.value是option_id,而不是值.那么如何让它过滤实际的期权价值呢?