Automatically filter collections based on store selector

Hey,

We’re running a Shopify store on the Local Theme.

We have multiple locations, thus we’re using the “Store selector” that is availible in the Local theme, where different products is avaliable in different stores. Each store is then tied to a specific location, with seperate inventory levels.

I’m looking for a solution where my product collections are automatically filtered based on the store that I’ve chosen in the “Store selector”. I started playing around filtering collections based on metafields, but did not manage to solve the problem.

Does anyone know how to set up a dynamic filter that is adjusted based on the choice in the store selector?

If this requires custom coding it might be interesting for us to pay a freelance consultant to help us with this feature.

Thank you!
Alex

you can do this but it needs a combo of JavaScript cookies or localStorage and some smart Liquid filtering

Liquid runs on the server so it can’t read the cookie or localStorage directly
so you gotta use JavaScript to hide or show stuff after the page loads

or if you’re doing separate subdomains like us.mysite.com and uk.mysite.com then you can use Shopify’s Markets to assign different content that way and it’s all handled natively

another way is using tags on the collections like tag everything you want for US with a tag like “us-store”
then in your code check what the customer selected and filter based on that