manbru
July 17, 2024, 5:53am
1
Hey,
I’m having some trouble with my filters they don’t work as you can see in the image i can check any box but nothing happens, i have tried looking into the code but have not been able to fix it. Then i found all these errors and thought it might have to do something with it.
my store: https://r1vex.myshopify.com/
Go to ‘Online Store’ → Theme → Edit Code, locate the file ‘facets.js’ find line 65 and add backticks to the template literal like this:
const url = `${window.location.pathname}?section_id=${section.section}&${searchParams}`;
manbru
July 17, 2024, 6:27am
3
bruv my coding skills ain’t good, how do i know what backticks to add to the template
Jump to Edit code and find the file “facets.js ”
on like no 65 add code
const url = `${window.location.pathname}?section_id=${section.section}&${searchParams}`;
manbru
July 17, 2024, 6:39am
5
i added it like this:
maybe it’s wrong because it gave more errors:
Go to line 65 of facets.js and replace the line with this:
const url = `${window.location.pathname}?section_id=${section.section}&${searchParams};`
Go to ‘Online Store’ → Theme → Edit Code
In the assets folder find the file ‘facets.js’
Copy the below code
const url = `${window.location.pathname}?section_id=${section.section}&${searchParams}`;
Go to line 65, and replace the line which looks like this
const url = ${window.location.pathname}?section_id=${section.section}&${searchParams};
with the code you just copied.
After everything it should look like this:
sections.forEach((section) => {
const url = `${window.location.pathname}?section_id=${section.section}&${searchParams}`;
const filterDataUrl = (element) => element.url === url;
FacetFiltersForm.filterData.some(filterDataUrl)
? FacetFiltersForm.renderSectionFromCache(filterDataUrl, event)
: FacetFiltersForm.renderSectionFromFetch(url, event);
});