Changing the "Sort By" drop down menus code so that Best Selling is the default in the Venture theme.

New Member
4 0 0

Hello

I know there is a way to do this by going Products>Collections>Necklaces(for example) and then scrolling down to Products and changing the "sort by"   I have a lot of collections and I would like to do this in the code.

Can anyone tell me where and how to modify the code?

 

Thanks, 

 

John

0 Likes
Shopify Expert
9981 84 1492

Hey John,

For this to be the default option you'll want to change that on the collection itself. So that's either in the Admin or via the API.

You could change the url links in the theme to include the sorting preference parameter but you'd need a really good reason to not just change the defaults on the collection itself.

If you have 1000s of collections a small script using the API could change the sort order quickly without much effort.

★ Winning Partner of the Build a Business competition. ★ http://freakdesign.com.au
0 Likes
New Member
4 0 0

Jason

  Thanks you!  Any insight as to how I would change it in the API?

John

0 Likes
Highlighted
New Member
4 0 0

i just sent this to suport. i think its what your trying to do 

 

      I figured it out!!! BUT when i exchange the    "alphabetical",   "default":  TO  "default": "Date, new to old"  it says 

(pop up) VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV

An error prevented list-collections-template.liquid from being saved. 

 

why and how can i change that?

 

thank you 

 

 

 

                         (IN list-collections-template.liquid) 

(I want this)

  "type": "select",

        "id": "sort",

        "label": "Sort collections by:",

        "info": "Sorting only applies when 'All' is selected",

        "default": "Date, new to old",            (<===========LOOOK) 

        "options": [

          {

            "value": "products_high",

            "label": "Product count, high to low"

          },

          {

            "value": "products_low",

            "label": "Product count, low to high"

          },

          {

            "value": "alphabetical",

            "label": "Alphabetically, A-Z"

          },

          {

            "value": "alphabetical_reversed",

            "label": "Alphabetically, Z-A"

          },

          {

            "value": "date",

            "label": "Date, old to new"

          },

          {

            "value": "date_reversed",

            "label": "Date, new to old"

 

 

it is the 

 

 

   "type": "select",

        "id": "sort",

        "label": "Sort collections by:",

        "info": "Sorting only applies when 'All' is selected",

        "default": "alphabetical",   (<================ LOOOK)  :(

        "options": [

          {

            "value": "products_high",

            "label": "Product count, high to low"

          },

          {

            "value": "products_low",

            "label": "Product count, low to high"

          },

          {

            "value": "alphabetical",

            "label": "Alphabetically, A-Z"

          },

          {

            "value": "alphabetical_reversed",

            "label": "Alphabetically, Z-A"

          },

          {

            "value": "date",

            "label": "Date, old to new"

          },

          {

            "value": "date_reversed",

            "label": "Date, new to old"

 

0 Likes