That's not a typo.
I am aware that I need to use 'finset' to filter my multi-select attributes; however, I am trying to filter multiple values at once and getting:
Incorrect parameter count in the call to native function 'FIND_IN_SET
.
Here's some sample code:
foreach ($options as $option) {
// $option[0] contains an attribute ID as a string
$attribute = Mage::getModel('catalog/resource_eav_attribute')->load($option[0]);
if ($attribute->getFrontendInput() == 'multiselect') {
$collection->addAttributeToFilter($attribute->getAttributeCode(), array('finset' => $option[1]));
} else {
$collection->addAttributeToFilter($attribute->getAttributeCode(), array('in' => $option[1]));
}
}
What I have on the frontend is a set of fields, each set corresponds to a specific attribute and contains checkboxes for each attribute value. Based on these submissions, the collection should filter out what has been selected.
Everything works great except for the single case where I attempt to filter two of the multi-select options at the same time. If I only choose one of them, the search works properly. If I choose two or more, I get the MySQL error mentioned above.
Any ideas? Or am I forced to use custom SQL statements to build this filter?
catalog_product_index_eav_idx
table.