Creating a link to a filter choice?

Hi all, hoping for some help on this if anyone is kind enough.

I’m trying to link to a product page (CPT and non WooCommerce) that has a checkbox filter. The page is working fine and the filter works great, however, when I try to link to the filter choice, for example /products/?product-sort%5B%5D=cateringhospitality nothing happens.

It seems that the checkbox has to be ticked to make the filter work, but I can’t link to it directly?

1 Like

You should be able to use a link to the page with the checkbox url to activate the checkbox by the link.

Maybe make sure its a full link and not a link param

I checked it on a taxonomy and it works.

Link also looks the same. Might “product-sort” interfere with some WooCommerce option? Maybe try adding a _ before it in the settings of the checkbox for url parameter to rule that out.

Thanks so much for your reply.

After reading your reply, I think I’ve discovered the issue, and it’s one of my making. I had several filters on the page, but duplicated the URL parameter so I guess the link didn’t know which filter I was trying to point to, hence why the filter was checked after clicking the link, but the loop wasn’t updated.

I now have this on my filter:

URL parameter: filter-sector

and my link is now:

Link type: Internal post/page & Products (Page)
URL parameters: ?filter-sector%5B%5D=cateringhospitality

All seems working now, and a valuable lesson learned!