Results 1 to 2 of 2

Thread: Bug with filter for attribute with multiple options

  1. #1
    New user
    Join Date
    03-22-12.
    Posts
    2

    Default Bug with filter for attribute with multiple options

    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.

  2. #2

    Default Re: Bug with filter for attribute with multiple options

    With your changes It gives a proper value in template. Now I have filter with drop down list. But it don't filter at all, does yours?
    OM MANI PEME HUNG! how many has to die for freedom and dignity. Save this world

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •