Handleize filter in JavaScript

tyteen4a03
New Member
1 0 1

Hey! I'm the developer behind Snaptee's new store. We came across a situation where we need to get a collection's handle in JavaScript. Since Shopify doesn't provide a handleize filter function in JavaScript, I ported the one in liquid to JavaScript; it's available here.

Same with the liquid counterpart, it does not check against situations where two different products have the same title.

Six years later, I want to thank you for this!

Although you basically copied what Liquid does, somehow those accented characters may remain so you may need some additional modifications to the code if the things you're trying to handleize aren't in English.

If my reply helped you, please give it a Like and mark it as Accepted Solution.
Do you need help customizing your theme or editing code? Check out my Fiverr gig.