Custom sort option

Custom sort option

ryan29
Shopify Partner
1 0 0

I want to add custom option to the sort option on the collection page help me with. my store theme is impact.

Reply 1 (1)

LitExtension
Shopify Partner
4963 1010 1192

Hi @ryan29 ,

Since you're using the Impact theme, here's how you can add a custom sorting option to your collection page. Shopify themes come with built-in sort options like "Best Selling", "Price Low to High", etc., but adding a custom one (like "Sort by Popularity" or "Sort by Custom Tag") requires a bit of theme code editing.

Step-by-step guide:

  1. Access your theme code:
    • Go to Online Store > Themes in your Shopify admin.
    • Click Actions > Edit code on the Impact theme.
  2. Find the file that controls sorting:
    • Open main-collection.liquid or collection.liquid (sometimes inside the sections folder, depending on your version).
    • Look for this block: <select name="sort_by">
  3. Add your custom option:
    • Inside that dropdown, add your option like this: <option value="custom_sort" {% if collection.sort_by == 'custom_sort' %}selected{% endif %}>Sort by My Option</option>
  4. Handle the sorting logic:
    • Shopify doesn’t support truly custom sort logic on the frontend alone. You have two options:
      • Tag-based sorting: Create collections or use product tags to simulate a custom sort.
      • Manual order: Use a custom collection and sort it manually in Shopify admin.
      • Or, use an app like Search & Discovery or Boost Product Filter & Search for advanced sorting.
  5. (Optional) Modify the controller logic:
    • If your theme supports custom sort_by values via URL (like /collections/all?sort_by=custom_sort), you can use Liquid to display the products in a certain custom way. Otherwise, JavaScript might be needed.

If this was helpful, hit the like button and accept the solution.
Thanks

LitExtension - Shopping Cart Migration Expert
Check out our Shopify migration app to migrate your online store to Shopify
Contact us:
- Email: contact@litextension.com