Jump to content

Need some help with faceted filter


gdrasutis@gmail.com

Recommended Posts

I figured it myself, I read some similar topics here with no answer, so I put my solution here.

It is only need in /modules/ps_facetedsearch/src/Product/SearchProvider.php in runQury function before

 $filterBlockSearch = new Filters\Block(
            $facetedSearch->getSearchAdapter(),
            $context,
            $this->module->getDatabase()
        );

add fresh $facetedSearch instance, without filtered products like 

//        this line returns all filter values always
        $facetedSearch = new Search($context);

        // now get the filter blocks associated with the current search
        $filterBlockSearch = new Filters\Block(
            $facetedSearch->getSearchAdapter(),
            $context,
            $this->module->getDatabase()
        );

 

Link to comment
Share on other sites

  • 1 year later...
  • 4 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...