My product sort / filter feature is not working anymore

Hi! When viewing my store, the “Sort by” feature used to work, but now it does nothing no matter which filter I select. It does not sort by name, price, date, etc.

I am using the Minimal theme, and I found one similar question before so I followed the suggested solution of adding


before the /head tag in my theme.liquid, but this did not work.

I would really appreciate some help with getting it to work again! Thank you!

Hi @DreamInDrops

Could you share your store URL to check?

Hello @DreamInDrops

I found the issue in your store and fixed it using the console, it worked fine for me.

See the screenshot:
https://prnt.sc/yRmZQ-oDp0o9
To apply the same solution to the store I need to update your theme code a little.

Yes, sure! Its dreamindrops.ca

Hi Prakash! I’m fairly comfortable editing the theme code. What changes do I need to make?

https://prnt.sc/zgaq-y7M4YmL This line of code you need to move it after you initialize the theme object.
After this https://prnt.sc/8bYWeqYED5U9

Also update this

theme.productStrings.sortBy

@DreamInDrops

If you still think I can help you please let me know. I won’t charge anything for this.
@DreamInDrops

Hi! I was having the same issue and you just helped me solve it after YEARS of trying! Thank you! The only issue I’m having now is that when I switch the ‘Sort by’ it becomes “blank.” For example when you go to the bracelets section of my website and change the sorting order…

After trying a few places to insert the script, I had put it in the attached place cause that caused the least problems. Any ideas to get that Sorting title text back?

@prakashVt I would be extremely grateful if you could, yes please! I tried updating “theme.productStrings.sortBy” and it works to sort, except the text in the dropdown menu becomes blank like stated below.

I could not locate the line of script code (“override default values” etc.) to move below the window.theme, and when I added it manually it messed things up in my header despite being exactly as shown.

@prakashVt just following up to accept your offer since I can’t get this to work correctly. Also I think I might have installed your app, which I didn’t know you had, so that’s a fun coincidence! :slightly_smiling_face:

Hey @DreamInDrops
Sure no worries
Let me ask for the store access request and then I’ll work on it. Thanks

Thanks @nadinelk1 for the feedback.
Here next what we need to do

  1. remove this line from the theme.js

  1. Add this line to the collection.sorting.liquid

Please accept/like my solution if this works for you so others can also get the correct answer.

THANK YOU!!! That worked perfectly!! Thank you so much! I can’t believe I FINALLY found the answer! You don’t also happen to know how to help with the changes to the packing slip template, do you? My legacy packing slip included the line items printing in a table with the table lines printing and the new one won’t print the lines.

Good to hear @nadinelk1
Could you please contact me via email for this query.

Thanks. Please do like my solution.

Hey @DreamInDrops The issue is resolved and have sent you one email. Please confirm it.

Confirmed and accepted as the solution. You have been a great help!