Filter problem / Documentation problem

Hello there!

I am developing a product filter according to the official documentation: Filtering
URL-address and filtering is correctly.

Problems:

  1. If you select multiple options in one of the filters, only the last pressed option remains checked.
  2. An error occurs when displaying an object: {{ filter.active_values }}

Please help solve the problems. I would be very grateful to you.

Here is my code. I have checked it several times. It fully complies with the documentation. If you paste a snippet from the official documentation, it works the same way!


	

**Here are screenshots of the problem**

Step 1 — Selecting and apply filter options on page: «/collections/all»:
<strong>
![Снимок экрана 2021-10-05 в 15.36.17.png|2142x990](upload://wfjAPdxeq8eJ4pmS6XdfHjmAzHq.png)
</strong>

Step 2 — Filtration results. The page address is correct. The list of goods is correct. Checkboxes aren't correct.
Object {{ filter.active_values }} isn't displayed (error)

![Снимок экрана 2021-10-05 в 15.37.32.png|2910x1838](upload://1mIWKeDxTmHcGAHT7MqftUdPEYW.png)

I solved the problem. The filter does not work correctly only in the local copy of the store.

1 Like

Hi,

Can you confirm what you mean by this?

Do you just mean that your filters didnt work while you were in ‘preview’ mode but then they started working correctly when you set the theme to ‘live’?

Im having problems rewriting the filters too but Im having to recreate the filter by tag functionality so using collection.all_tags instead and wondering if it will work differently if I set the theme to ‘live’.

In my case, after applying the filter, only the last selected value (checkbox) was transmitted to the URL. I advise you to do a git push after every filter change and test it on a live store.

Thanks for sharing this. It helped me work around the issue - I was only seeing the problem when using shopify theme serve but if I push my code to the published theme, the issue goes away. Frustrating!

1 Like