Jump to content

Prestashop 1.7 - Faceted search configured and enabled but not showing


GennosukeSama

Recommended Posts

Hi there!

I've configured Faceted search according to instructions, have added multiple categories with associated items in the corresponding template configuration, I've checked that positional hooks are active (it shares the same with the category list module. which works fine!) but still I see no faceted search anywhere in the shop!

I even inspected the html source and removed hidding classes but all that was rendered in the search facet was the OK button, which did appear after removing the css class.

I'm using the default theme. What could I be missing here? I did no changes to existing code.

Any ideas are welcomed!

Screenshot from 2020-04-04 23-38-08.png

Screenshot from 2020-04-04 23-43-02.png

Screenshot from 2020-04-04 23-43-39.png

Screenshot from 2020-04-04 23-44-29.png

Screenshot from 2020-04-04 23-45-53.png

Link to comment
Share on other sites

  • 5 months later...

Hi, 

After hours of search, i found where is the problem.

I recommand to uninstall 3.0.2 version which is not stable (lot of bugs)

  • Uninstall version 3.0.2 and delete folder
  • Install version 2.2.1 (has less options but works well)

Than, check the tpl inside /modules/ps_facetedsearch/src . File is Ps_FacetedsearchProductSearchProvider.php

By default, the faceted is unavailable if there are no products matching filters, and if there is ONLY 1 item that match filters (more than 1, it will show up)

To remove this, you need to find and edit this code

> This one will show 0 if there are no products, if you don't want it, you can leave the original value $filter->setDisplayed(false)   

    private function hideZeroValues(array $facets)
    {
        foreach ($facets as $facet) {
            foreach ($facet->getFilters() as $filter) {
                if ($filter->getMagnitude() === 0) {
                    $filter->setDisplayed(true);
                }
            }
        }
    }

> This one, will show search filters if you have more than 1 product matching filters, if there is 1 product, it will not show up, you can remove it to show "Product(1)" result

$facet->setDisplayed(
                $usefulFiltersCount > 1);

 

Hope this helps you and other people here ! 

Link to comment
Share on other sites

  • 1 month later...
On 10/4/2020 at 2:17 AM, AfterGlow93 said:

Hi, 

After hours of search, i found where is the problem.

I recommand to uninstall 3.0.2 version which is not stable (lot of bugs)

  • Uninstall version 3.0.2 and delete folder
  • Install version 2.2.1 (has less options but works well)

Than, check the tpl inside /modules/ps_facetedsearch/src . File is Ps_FacetedsearchProductSearchProvider.php

By default, the faceted is unavailable if there are no products matching filters, and if there is ONLY 1 item that match filters (more than 1, it will show up)

To remove this, you need to find and edit this code

> This one will show 0 if there are no products, if you don't want it, you can leave the original value $filter->setDisplayed(false)   


    private function hideZeroValues(array $facets)
    {
        foreach ($facets as $facet) {
            foreach ($facet->getFilters() as $filter) {
                if ($filter->getMagnitude() === 0) {
                    $filter->setDisplayed(true);
                }
            }
        }
    }

> This one, will show search filters if you have more than 1 product matching filters, if there is 1 product, it will not show up, you can remove it to show "Product(1)" result


$facet->setDisplayed(
                $usefulFiltersCount > 1);

 

Hope this helps you and other people here ! 

I am glad you discussed this issue.
I had a similar problem.
However, after I tried the ones you suggested, this problem still wasn't resolved. In fact, the Ps_FacetedsearchProductSearchProvider.php file doesn't appear to be executing.

I am using version v3.6.0

I beg your kindness to help me.

I thank you very much.

Link to comment
Share on other sites

  • 6 months later...

I think I have the same problem. It perfectly worked when I was working onto customizing classic theme on a local server. Then I imported it into the test environment and the faceted search doesn't appear anymore.

the div appears in the HTML but it's empty.

I don't know where to look.

Link to comment
Share on other sites

  • 3 months later...
  • 10 months later...

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