You are here:  » Front End Product Filter not working


Front End Product Filter not working

Submitted by bat on Fri, 2017-12-29 14:39 in

Hi David,
Merry Xmas to you.
I've come across an issue with my site {link saved}
It's using a sidebar tickbox filter for desktop and the default one for mobile however the mobile one doesn't work.

The only thing I've noticed which seems "different" is that using desktop sidebar filter, I get this in the url: brandFilter%5B%5D=AGV
whereas the default filter that doesn't work: brandFilter=AGV

Can you advise please?

Thanks!

Submitted by support on Fri, 2017-12-29 15:31

Hi,

I think all you need to do is change the name attributes of the select boxes in the default html/searchfilters.php to use PHP's array format notation for $_GET variables e.g. brandFilter[] instead of just brandFilter - changes as follows;

Look for the following code at line 44:

  print "<select name='merchantFilter'>";

...and REPLACE with:

  print "<select name='merchantFilter[]'>";

And then the following code at line 84:

  print "<select name='categoryFilter'>";

...and REPLACE with:

  print "<select name='categoryFilter[]'>";

And then the following code at line 113:

  print "<select name='categoryFilter'>";

...and REPLACE with:

  print "<select name='categoryFilter[]'>";

And finally the following code at line 142:

  print "<select name='brandFilter'>";

...and REPLACE with:

  print "<select name='brandFilter[]'>";

Cheers,
David.
--
PriceTapestry.com

Submitted by bat on Fri, 2017-12-29 15:41

Awesome! Thanks so much. Works a treat.