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

fucsun
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
Jasoliya
Shopify Expert
4221 569 1041

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 Or WhatsApp Or Skype: jasoliya.brijesh
Want to get Free review and advice for sale on store ?? just text me here
fucsun
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
Jasoliya
Shopify Expert
4221 569 1041

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 Or WhatsApp Or Skype: jasoliya.brijesh
Want to get Free review and advice for sale on store ?? just text me here
0 Likes
fucsun
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
Jasoliya
Shopify Expert
4221 569 1041

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 Or WhatsApp Or Skype: jasoliya.brijesh
Want to get Free review and advice for sale on store ?? just text me here
arpitbanati
New Member
2 0 0

Thanks, your answer was of great help to me.

I am new to Shopify and don't know much about it, so my first approach was to edit 'sort_options' object from which the for loop is extracting all the options but I couldn't find where all the data is defined. It would be very helpful if you could tell me where is this 'collection'/'sort_options' object stored or from where this theme is pulling all its data.

 

Thanks in advance.

0 Likes
Jasoliya
Shopify Expert
4221 569 1041

Hi @arpitbanati 

You can find this code in 

1. Go to Online Store->Theme->Edit code
2. Section->collection-template.liquid->find  id="SortBy" 

Want to modify or custom changes on store hire me.
If helpful then please Like and Accept Solution.
Email: jasoliyabrijesh123@gmail.com Or WhatsApp Or Skype: jasoliya.brijesh
Want to get Free review and advice for sale on store ?? just text me here
0 Likes
SociallyUnique
New Member
3 0 0

Hi there,

 

I wanted to remove "Featured" from my drop down menu. I followed your instructions, but I can't seem to find this line item in the code.

 

Would you be able to help me? Let me know what you need from me.

 

Thanks!

0 Likes
Jasoliya
Shopify Expert
4221 569 1041

You can find this code in :

1. Go to Online Store->Theme->Edit code
2. Section->collection-template.liquid->find  id="SortBy" 

Then place this code instead of liquid and manage this as you want or any change 

<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>

 

Want to modify or custom changes on store hire me.
If helpful then please Like and Accept Solution.
Email: jasoliyabrijesh123@gmail.com Or WhatsApp Or Skype: jasoliya.brijesh
Want to get Free review and advice for sale on store ?? just text me here
0 Likes