Disable sort by "best selling" and "Date, new to old" in Warehouse theme

AlexandreMaxime
New Member
1 0 0

I couldn't find this anywhere. Any advice would be very helpful! :).

Screenshot 2021-10-15 100445.jpg

Reply 1 (1)
Ecommpremium
Shopify Partner
269 22 52

@AlexandreMaxime  

As in this sort filter box are generate by liquid code so you ahve not any option to change code. but instead of we have one way like you can add custom select box.

Go to Snippet->collection-sorting.liquid and fine below code:

 <select name="sort_by" id="SortBy" class="btn--tertiary" aria-describedby="a11y-refresh-page-message">
  {% for option in collection.sort_options %}
     <option value="{{ option.value }}"{% if sort_by == option.value %} selected="selected"{% endif %}>{{ option.name }}</option>
  {% endfor %}
  </select>

Now you can remove this and add this custom box and change whatever you want but dont change value of option  

<select name="sort_by" id="SortBy" class="btn--tertiary" aria-describedby="a11y-refresh-page-message">
     <option value="manual">Featured</option>  
     <option value="best-selling">Best selling</option>  
     <option value="title-ascending">Alphabetically, A-Z</option>  
     <option value="title-descending">Alphabetically, Z-A</option>  
     <option value="price-ascending">Price, low to high</option>  
     <option value="price-descending">Price, high to low</option>  
     <option value="created-ascending">Date, old to new</option>  
     <option value="created-descending">Date, new to old</option>
  </select>
- Did we solve your issue? Like & Mark As Solution to help the community
- Should you need any direct help: contact@ecommpremium.com
- SKYPE: ahsanaliawan
- shopifyexperts