How do i delete one of the options on the SortBy dropdown menu?

Highlighted
Tourist
6 0 0

I want to get rid of the alphabetical options and the date options but can't find the code to do so.  Can anyone help me out?

 

Thank you in advance!

 

Screen Shot 2019-04-28 at 10.37.30 PM.png

0 Likes
Shopify Partner
1773 289 376

Hi,

I think its Boundless theme if so then follow bellow:

1. Go to Online Store->Theme->Edit code
2. Section->collection-template.liquid->find  id="SortBy" and remove option from here and save.

Note:If not then send me your store URL and theme name.

Let me know if you want help.

Want to modify or custom changes on store hire me.
If helpful then please Like and Accept Solution.
Email: jasoliyabrijesh123@gmail.com
Skype: jasoliya.brijesh
1 Like
Tourist
6 0 0

That would be only if I wanted to delete the entire thing but I only want to delete a few options. 

Website URL: Fucsun.com

theme: Boundless

0 Likes
Shopify Partner
1773 289 376

Yes, from this instruction you can remove any option from select box.

You can see like this on page:

 <select name="SortBy" id="SortBy" data-value="{{ collection.sort_by | default: collection.default_sort_by | escape }}">
          <option value="manual">{{ 'collections.sorting.featured' | t }}</option>
          <option value="best-selling">{{ 'collections.sorting.best_selling' | t }}</option>
          <option value="title-ascending">{{ 'collections.sorting.az' | t }}</option>
          <option value="title-descending">{{ 'collections.sorting.za' | t }}</option>
          <option value="price-ascending">{{ 'collections.sorting.price_ascending' | t }}</option>
          <option value="price-descending">{{ 'collections.sorting.price_descending' | t }}</option>
          <option value="created-descending">{{ 'collections.sorting.date_descending' | t }}</option>
          <option value="created-ascending">{{ 'collections.sorting.date_ascending' | t }}</option>
   </select>

Remove bellow line from above code 

<option value="title-ascending">{{ 'collections.sorting.az' | t }}</option>
<option value="title-descending">{{ 'collections.sorting.za' | t }}</option>

Let me know if you need help.

Want to modify or custom changes on store hire me.
If helpful then please Like and Accept Solution.
Email: jasoliyabrijesh123@gmail.com
Skype: jasoliya.brijesh
0 Likes
Tourist
6 0 0

I'm not given that option mine says this

 

 

Screen Shot 2019-05-10 at 11.22.10 AM.png

0 Likes
Shopify Partner
1773 289 376

Change like this:

 

{% for option in collection.sort_options %}
    {% unless option.value contains 'title-ascending' or option.value contains 'title-descending'  %}
        <option value="{{ option.value }}" {% if sort_by == option.value %} selected="selected" {% endif %}>{{ option.name }} </option>
    {% endunless%}
{% endfor%}

Note: just add unless and endunless condition 

 

Let me know if need help.

 

Want to modify or custom changes on store hire me.
If helpful then please Like and Accept Solution.
Email: jasoliyabrijesh123@gmail.com
Skype: jasoliya.brijesh
1 Like