Jump to content

DropDown problem in layered filter


Recommended Posts

Hello everybody, i found a quite annoying problem with dropdown and radio buttons in layered search. The symtpoms are then when in the front office you choose a value for a feature (or category, or manufacturer) that in the layered filter is positioned lower than a dropdown or a radio button, every chosen dropdown or radio button value that is positioned higher is then reset.

This means that the layered search is unusable if you need a dropdown. Everytime you set a value below the one set in dropdown(s), every value chosen in the dropdown(s) is reset.

 

This is because i noticed that when selecting a checkbox higher than the dropdown, the "search url" in the dropbox code is something like 

 



"http://casa.fotovallescrivia.it/12-auto?order=product.position.asc&q=Raggio-R16/ClasseEnergetica-E./Rumore-2/Altezza-45"


 

where "Raggio-R16" is the feature-value of the dropdown value currently selected.

 

in the same page, at the same moment, the "search url" of every other checkbox code lower than the dropdown, is missing the "Raggio-R16/"



"http://casa.fotovallescrivia.it/12-auto?order=product.position.asc&q=ClasseEnergetica-E./Rumore-2/Larghezza-195" 


 You can see that in the attachment:

post-1367190-0-37114900-1488461700_thumb.png

 

 

so, when i select or deselect a checkbox lower than the dropdown, the value selected in the dropdown is reset.

 

so, it is impossible to use the dropdown. How is this possible? nobody uses dropdowns? This happens only with dropdowns or ratdio. Checkboxes are working fine.

Where should i investigate to have this problem solved (i want al checkoxes, higher and lower than the dropdown, to keep the selected dropdown value when checked/unchecked)?

 

This is happening even on a fresh install with the test database, if you just introduce one dropdown higher than a checkbox.

Edited by machiavellino (see edit history)
Link to comment
Share on other sites

I'm currently using 1.7.0.5 and 1.7.0.4 on both linux and windows apache. I'll try the beta version to check if the problem is still there. But i hope it will be released an update of the layered search module for 1.7.0.5 too.

Thank you for your reply, i'll let you know.

Link to comment
Share on other sites

The problem persists in 1.7.1.0 beta.

Introducing a dropdown or radio makes the layered search unusable. 

I'm posting a bug report.

 

Meanwhile, do you know in which php files i should look (even if i prefered not to)  to see if i can work this around? it looks like a problem one can solve "easily" once you got the right part of code in your hands.

Link to comment
Share on other sites

  • 5 weeks later...

Check the files in the modules/ps_facetedsearch directory (and themes/classic/modules/ps_facetedsearch directory).

 

I had finally some time to check the code, and i found that the problems lies in the content of the variable "nextEncodedFacets"

 

i opened a page where in the url i have the "q=Marca-APOLLO/Raggio-R16"

 

 

referring to the feature visualized with the drop down list:

the following values  are referred to a feature with lower index (Altezza) (so it is higher in the widget layout), and selecting a value for this feature yelds no problem at all.

 2 => Array (7)
    label => "Altezza"
    displayed => true
    type => "feature"
    properties => Array (1)
      id_feature => 1
    filters => Array (7)
      0 => Array (10)
        label => "45"
        type => "feature"
        active => null
        displayed => true
        properties => Array (0)
        magnitude => 3
        value => 37
        nextEncodedFacets => "Marca-APOLLO/Raggio-R16/Altezza-45"
        facetLabel => "Altezza"
        nextEncodedFacetsURL => "http://eni.fotovallescrivia.it/2-home..."

The following values are referred to:

a feature that has a higher index than the drop down list feature, and nextEncodedFacets => "Marca-APOLLO/Carico-84." is missing the "Raggio-R16". So, if i select a value for this or any other feature lower than the drop down list, the value "R16" is deselected from the filter!

9 => Array (7)
    label => "Carico"
    displayed => true
    type => "feature"
    properties => Array (1)
      id_feature => 13
    filters => Array (17)
      0 => Array (10)
        label => "84."
        type => "feature"
        active => null
        displayed => true
        properties => Array (0)
        magnitude => 2
        value => 200
        nextEncodedFacets => "Marca-APOLLO/Carico-84."
        facetLabel => "Carico"
        nextEncodedFacetsURL => "http://eni.fotovallescrivia.it/2-home..."

Can someone give me a hint on where to look for the code that populate the "filters" array, which contains the "nextEncodedFacets" values? I've tryed themes/classic/modules/ps_facetedsearch and /modules/ps_facetedsearch but found nothing..

 

Any help would be appreciated, thanks.

Edited by machiavellino (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...