You are here:  » Sidebar Filter Failing for Category Results After Page 1


Sidebar Filter Failing for Category Results After Page 1

Submitted by ChrisNBC on Fri, 2016-11-18 11:27 in

Hi David,

Hope all is going well.

The site I’m working on currently uses category hierarchy. It’s going well and nearing completion but I’ve noticed that when I select a category and then filter the results and click on the next page of results (using the page number or ‘next’) the filter applied vanishes and the results display unfiltered. The first page filters correctly.

I checked the filters on non category results and they work fine.

I wondered if you might be able to suggest what could be going wrong and how I may be able to fix it.

Thanks in advance.

Best regards
Chris

Submitted by support on Fri, 2016-11-18 12:54

Hi Chris,

Please could you post an example link of the Category page, and then the URL that is displayed after you apply the filter (this may be no different as I think you are using an AJAX filter mod), and then the URL after clicking through to page 2...

Thanks,

David.
--
PriceTapestry.com

Submitted by ChrisNBC on Fri, 2016-11-18 15:11

Hi David,

Thanks for the quick response.

The Category page is: http://www.example.com/category/Category1/Category2/

After the (merchant) filter is applied the link is: http://www.example.com/category/Category1/Category2/

After the 2nd page link is clicked the url changes to: http://www.example.com/category/Category1/Category2/?q=category%3ACategory1%2FCategory2&page=2&sort=relevance&merchantFilter=Merchant+Name

I just also tried the price filter by setting a max value. The price filter does not auto submit, so I had to click the ‘filter’ button and I noticed the price filter remains active on subsequent pages.

I then tried just the ‘merchant’ filter again but I clicked the filter button after the AJAX refresh and notice the filter remains active on subsequent pages. Do you think it’s the auto submit causing the issue?

In each instance above, I clicked on the category before each test to make sure everything reset.

Thanks in advance.

Best regards
Chris

Submitted by support on Fri, 2016-11-18 15:35

Hi Chris,

I checked the latest search.php that I have from you by email, and I notice that the pagination is re-written in the AJAX response so think all you should need to do is make sure that rewrite is set to false for an AJAX request - so where you have the following code at line 705:

    ob_start();

...REPLACE with:

    ob_start();
    $rewrite = FALSE;

Hope this helps!

Cheers,
David.
--
PriceTapestry.com

Submitted by ChrisNBC on Fri, 2016-11-18 16:23

Hi David,

Thanks for your message above.

I have made the change you suggest above but it does not appear to have made a difference. I actually found two instances of the text to be replaced in search.php, so I replaced one tested and then replaced the second also but neither change has fixed the issue. Is there anything else you could suggest that might resolve it?

Thanks in advance.

Best regards
Chris

Submitted by ChrisNBC on Fri, 2016-11-18 16:37

Hi David,

Since writing the last post, I have just noticed accessing the link: {link saved} and setting a filter works fine, it just seems to be a problem when accessing the results through a category link such as ({link saved}) . Hope this helps?

Best regards
Chris

Submitted by support on Fri, 2016-11-18 16:52

Hi Chris,

Ah - I've just realised that the version of html/navigation.php on which your template is based was not explicitly linking to search.php (I only added that in 15/09A) so to correct this, edit the file and use your text editor's search and replace functionality to modify as follows:

Search:

?q=

Replace:

/search.php?q=

(there should be 4 instances)

Hope this helps!

Cheers,
David.
--
PriceTapestry.com

Submitted by ChrisNBC on Fri, 2016-11-18 17:03

Thanks David, The above change has fixed it.

Have a great weekend.

Best regards
Chris