Hello!
I am trying to remove the “Best selling” option from the “Sort by” because it is irrelevant for my website. Some solutions has been posted but it does not work on the Craft Theme.
Can someone help me please ?
Hello there,
To remove the “Best-Selling” sorting option from the Craft theme on Shopify, you’ll need to make some modifications to the theme’s code. Here’s how you can do it:
Login to your Shopify admin panel and go to “Online Store” and then “Themes.”
Find the Craft theme and click on the “Actions” dropdown menu, then select “Edit code.” This will open the theme code editor.
In the theme code editor, locate the “collection.liquid” file under the “Sections” or “Snippets” directory. If it’s not present there, you can also look for it in the “Templates” directory.
Open the “collection.liquid” file and search for the code that generates the sorting options. It might look something like this:
5.Find the “Best-Selling” option within the loop and remove the corresponding <option> tag. It should look like this:
{% for option in collection.sort_options %}
{% unless option.value == 'best-selling' %}
{% endunless %}
{% endfor %}
Save the changes you made to the file.
Visit your Shopify store and navigate to a collection or product listing page. The “Best-Selling” sorting option should no longer be visible.
By following these steps and modifying the “collection.liquid” file in the Craft theme’s code, you can remove the “Best-Selling” sorting option from your Shopify store.
Hi @developerSP !
Thank you for your reply!
But as you can see and the following screenshot, the Craft Theme does not present a “collection.liquid” section. I can not find the “Best-Selling” option in any of these sections which contains the word “collection”.
Can you help me figure this out?