I spend couple hourt to make filter with multiple selection. And i found bug.
PRE:
Attrributes:
- checkbox menu (3 options)
- mandatory field - checked
- Multiple selection - checked
Other options without change.
there is no chance to see filter for multiple selection because in template, because in ModuleIsotopeProductFilter.php variable $arrValues has value like this (this is eg for 2 select options):
Code:
Array
(
[0] => a:2:{i:0;s:11:"value 1";i:1;s:13:"value 2";}
)
and code:
Code:
//ModuleIsotopeProductFilter.php line 280
if (!in_array($option['value'], $arrValues))
{
unset($arrOptions[$k]);
continue;
}
This is serialized array. So to fix it I wrote:
Code:
if ( $arrWidget['multiple'] )
{
$arr = array();
for ($i=0, $n=count($arrValues);$i<$n;$i++) {
$arr = array_merge($arr, unserialize($arrValues[$i]));
}
$arrValues = $arr;
}
Now I have in tamplate in $this->filterOptions proper structure to make checkbox filter. I hope it will help for others.
Bookmarks