0
votes

I'd like to know how I could possibly rearrange the order of a list in Shopify. Now please do note that I have to use the default methods in Liquid as my boss doesn't let me create my own ones. And I also need to override the default order which is set in the admin panel. So is there a way to override it or how could I do it in Javascript? Thanks in advance, regards.

1
Can you add your solution as answer, and accept it? See this discussion on meta. - hjblok
Done, thanks for the intel. - Viktor

1 Answers

0
votes

[SOLUTION] I used the tinysort JQuery plugin (http://tinysort.sjeiti.com/)

$(document).ready(function() {
  $('table.tables').tsort({data:'price', order:'asc'});
});

This is if you have tables with the class "tables" and with the attribute data-price. The .ready is so that all DOMs and everything will be loaded before we execute the sorting. Hope someone will find this helpful.