Jump to content
machiavellino

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)

Share this post


Link to post
Share on other sites
Are you using the PrestaShop v1.7.1.0 Beta? If you are and it still doesn't work, you can post a bug report on the Forge so PrestaShop can fix it.

Share this post


Link to post
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.

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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)

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More