My filter button isn't work

My filter button isn't work

mai_truc
Visitor
2 0 0

My store has a filter button on the desktop, but once I've chosen an option, nothing changes until I refresh.

In my mobile, the button does not even present as an option.

my website is: https://ru9.vn/

Replies 4 (4)

kaiyaa
Trailblazer
310 24 30

Hello @mai_truc 

When we are changing variants it's showing a error so filters is not working 

kaiyaa_0-1713347908935.png

 

Was I helpful? Buy me a coffee
For fast response Message me
Need Help Message me
mai_truc
Visitor
2 0 0

Yes, I agree with you; I used the app "Filter & Search" options in Shopify, but it still does not function; what should I do?

kaiyaa
Trailblazer
310 24 30

You have to update some code in filter.js file

If you require further help to optimize your store, please don’t hesitate to reach out. If you find this information useful, a Like would be greatly appreciated. And if this solves the problem, please Mark it as Solution!

Was I helpful? Buy me a coffee
For fast response Message me
Need Help Message me

tim
Shopify Partner
3764 351 1384

There are several problems with your theme.

For example, in facets.js there is a hard-coded section id:

const url = `${window.location.pathname}?section_id=template--14675310936143__main-collection&${searchParams}`;

It may have worked before, but when you've modified the collection template the id is not longer matches and theme JS fails to fetch data to update product grid.

 

There is another place:

section: document.getElementById('product-grid').dataset.id,

where code expects your product grid element to have data-id attribute to use it later to construct URL, but it is missing.

This is probably the reason why section ID was hard-coded ...

 

Some CSS code is missing as well -- this is why you have duplicate options under "Availability" filter.

 

 

 

If my post is helpful, consider liking it -- it will help others with similar problem to find a solution.
I can be reached via e-mail tairli@yahoo.com