How to delete "sort by bestselling"? Where is this toolbar in Debut theme's code?

I want to go straight into the code of the Debut theme to comment out/delete the “sort by bestselling” option.

Where is this sort located in the code so I can do so?

Alternatively, what is an easy way to straight up delete this option if the above doesn’t work via code, etc?

I just want this gone.

1 Like

Hi coff

The liquid code you are searching for is in collection-template.liquid. Search for this line:

{{ ‘collections.sorting.title’ | t }}

Alternatively, you can disable sorting in Collection Pages settings:

Hey there, @coff001

Bo here from Shopify Support!

Great question. We will be adding some code to the very bottom of the theme.scss.liquid to achieve this.

NB When editing the CSS of your theme it is always a good idea to duplicate your theme first and making the changes on the duplicate. This will prevent any errors from occurring on your live site. We also recommend adding CSS to the bottom of the file as opposed to altering the preexisting code. The new code will overwrite the previous code.

Go to Online Store > Actions > Edit Code. Open the Assets Folder > theme.scss.liquid and scroll to the very bottom of the file. Add the following code:

#SortBy {
  option[value=best-selling] {
    display: none;
  }
}

Click Save.

Let me know how this goes and if there is anything else I can assist you with, I’m happy to help!

All the Best,

Bo

Hi Bo,

I’m assuming you meant theme.css becuase I see no "theme.scss.liquid" under Assets. I pasted the code there and it didn’t work, let me know what to do.

Doesn’t that disable all the sorts, though? You’re saying I should take out that 1 line, right?

I still want the other sort-by’s, just want to delete the bestselling one.

Yes, I misunderstood your problem:)

Replace this code:

{%- for option in collection.sort_options -%}
  
{%- endfor -%}

With this:

{%- for option in collection.sort_options -%}
{% if option.value != "best-selling" %}
  
{% endif %}
{%- endfor -%}

I added an if statement to filter out the best-selling option

1 Like

Apologies, @coff001 , you are absolutely correct, I was working off an older version of the theme which uses the file name theme.scss.liquid. Did @prinpadure 's steps work or would you like me to look further into this for you?

All the Best,

Bo

1 Like

@prinpadure 's solutoin worked, thank you both and take care during these times.

1 Like

go straight into the code of the Debut theme to comment out/delete the “sort by bestselling” option.

Where is this sort located in the code so I can do so?

Alternatively, what is an easy way to straight up delete this option if the above doesn’t work via code, etc?

more info

Hi Shopify,

I am trying to delete this “Sort By” menu (and the “6 products” listed on the right-hand side of this menu) from my Products page completely as I only have 6 products.
I have tried to add the code you suggested here into my Assets folder theme.css but it doesn’t get rid of the sort by menu?

Any advice on how I can do this would be greatly appreciated!

Hey there, @ShopMatilda

Could you please provide us with the name of your theme, a link to your store, and a screenshot of “6 products” listed on the right-hand side of this menu that you want to get rid of? Thank you.

Bo

Hello,

The theme name is Debut and the site link is

www.shopmatilda.com

I have attached a screenshot of the ‘Sort By’ menu and ‘6 products’ text below.

Thank you for your assistance!

Thanks for sharing this with me, @ShopMatilda ! This can be done in a few simple steps. We will start with the Sort By part.

  1. Go to Online Store > Themes > Customize.

  2. From the theme customizer select Collection page.

  3. Select “Collection Page” again from the sidebar and then disable product sorting:

  1. Click Save.

To remove the product count you will need to do a little bit of coding.

  1. Go to Online Store > Themes > Actions > Edit Code.

  2. Open the collection-template.liquid.

  3. Find the following code:


              {{ 'collections.general.items_with_count' | t: count: collection.products_count }}
            

  1. Replace it with the following:
{% comment %}  
              {{ 'collections.general.items_with_count' | t: count: collection.products_count }}
            
  {% endcomment %}
  1. Click Save.

Let me know how this goes and if there is anything else I can assist you with, I’m happy to help!

All the Best,

Bo

1 Like

Hey there,

Thank you so much for helping me with those changes.
The text ‘6 Products’ is still showing though - I would like to delete this if possible.

See screenshot attached.

Hey again, @ShopMatilda

Apologies for that, it looks like this is the All Products page as opposed to a regular collection page. Please look for the following code, it should be on line 67 or so:

{% if is_filter_by_available == false and section.settings.sort_enable == false %}
            {{ 'collections.general.items_with_count' | t: count: collection.products_count }}
          {% endif %}

Replace it with the following:

{% comment %} {% if is_filter_by_available == false and section.settings.sort_enable == false %}
            {{ 'collections.general.items_with_count' | t: count: collection.products_count }}
          {% endif %}  {% endcomment %}

Let me know how this goes and if there is anything else I can assist you with, I’m happy to help!

All the Best,

Bo

1 Like

Hi Bo,

Thank you very much for your help - this worked perfectly!

1 Like

Hello,

is there any other way to achieve this? Because before updating my theme it worked for me as well but now it stopped working even though the code should be implemented in the right way. The Theme is Expanse.

Hi,

I know this thread is several years old but, this is the only thing that’s relatable for what I’m trying to accomplish. I currently have the Ella Version 6.4.1 theme and I am simply trying to remove this generic “Best Selling” vendor example template that shows up in the cart. Any guidance from anyone would be greatly appreciated.

I would message shopify support. I tried to see if your situation was similar to mine but its a bit different so I’m not able to advise you.