Jump to content

Bug in module ps_facetedsearch (_mobile_search_filters_clear_all)


SLIVERPOOLS

Recommended Posts

Can someone help?
I found bug in the module ps_facetedsearch (it appears exclusively - on the mobile version)
Prestashop 1.7.7.4
ps_facetedsearch v3.7.1

Details:
On desktop version of site, when you mark some characteristic in the filter, the page is reloaded and the (clear all) button appears: http://joxi.net/bmoRJYdC7ljwGr . With this button you can clear ALL filter marks.
When you click this button: http://joxi.net/Dr8aP31cJDplpm , the page reloaded, ALL filter uncheck, and button disappear: http://joxi.net/1A5LGZ1tzwZEV2
All works well

But in mobile version of site, when you mark some characteristic in the filter, the page is reloaded and the (clear all) button WILL NOT APPEARS: http://joxi.net/52aXBnyHg0WnBm

If I watch code of the place — where must be button:
I will see the id="_mobile_search_filters_clear_all"
But with no code of the button itself:
http://joxi.net/RmzBoY5CjVdlym

Further, if I refresh the page (Сtrl+R) — the button WILL APPEARS!
http://joxi.net/vAWWOlMFBRyLxA
And in the opposite direction,
When you click this button on mobile: http://joxi.net/Y2LlQe4UMv8oz2 , the page reloaded, ALL filter uncheck, but button WILL NOT DISAPPEAR.
To make her disappear, you need to refresh the page manually (Сtrl+R):

Maybe it's a cache problem or something like that?
Thanks for any help

Edited by SLIVERPOOLS
url problem (see edit history)
Link to comment
Share on other sites

  • 11 months later...

Hello,

I just came across the same issue just now and found the fix for it on Github

To fix this, go to module folder in [your-theme]/modules/ps_facetedsearch/ps_facetedsearch.tpl

Then, replace

      <span id="_mobile_search_filters_clear_all"></span>

With:

      <button data-search-url="{$clear_all_link}" class="btn btn-tertiary js-search-filters-clear-all"> <i class="material-icons">&#xE14C;</i> {l s='Clear all' d='Shop.Theme.Actions'} </button>

In the end it should look like this:

{if isset($listing.rendered_facets)}
<div id="search_filters_wrapper" class="hidden-sm-down">
  <div id="search_filter_controls" class="hidden-md-up">
      <button data-search-url="{$clear_all_link}" class="btn btn-tertiary js-search-filters-clear-all"> <i class="material-icons">&#xE14C;</i> {l s='Clear all' d='Shop.Theme.Actions'} </button>
      <button class="btn btn-secondary ok">
        {l s='Exit' d='Shop.Theme.Actions'}
      </button>
  </div>
  {$listing.rendered_facets nofilter}
</div>
{/if}

Works great, although the button will be always shown.

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...