Re: Price filters refresh products list when changed in JS

Price filters refresh products list when changed in JS

jerome-sj
Shopify Partner
19 0 3

Hi, I'm customizing Shopify's filters and I want to add a slider selector to the price filter.

I was able to get the slider and update the values properly.

I want to refresh the products list when selecting a value, like when the text fields are updated normally. But I can't get to trigger the same event than the input[type=text].

Is there a way to refresh the list with the selected values without using the default "Search" button?

Replies 3 (3)

made4Uo
Shopify Partner
3848 717 1191

Hi @jerome-sj 

 

Depending on your theme, you should be able to use Javascript and call the default function to refresh the page. You can use input range instead. 

If this fixed your issue Likes and Accept as Solution is highly appreciated. Coffee tips fuels my dedication.
Get EXPERIENCED Shopify developers at affordable rates—visit Made4Uo.com for quick quote!
Do not lost your Shopify store! Get FREE trial with ✔️ Rewind Backup: Automatic, reliable, stress-free
jerome-sj
Shopify Partner
19 0 3

Yes, I'm able to refresh. But the deault behavior is that when you updaet the value in the textbox, the list is refreshed, but not the page, so the filter's box stays open. The page only refreshes when we click on "Search".

I'd like to have the same behavior.

I tried to trigger a change or keypress or keydown event on the text field but nothing is fired then.

I cannot figure what event is actually called.

made4Uo
Shopify Partner
3848 717 1191

You need to find the original Javascript function on your theme to refresh the page without loading. Add that to your event listener for your input

If this fixed your issue Likes and Accept as Solution is highly appreciated. Coffee tips fuels my dedication.
Get EXPERIENCED Shopify developers at affordable rates—visit Made4Uo.com for quick quote!
Do not lost your Shopify store! Get FREE trial with ✔️ Rewind Backup: Automatic, reliable, stress-free