Shopify

Mastering Shopify Product Sorting: Reorder Filter Options for Enhanced UX

Hey there, fellow store owners! As someone who spends a lot of time digging through the Shopify community forums, I often see common questions pop up that, at first glance, seem like simple tweaks but can quickly turn into a deep dive. One such gem recently caught my eye, and it’s all about getting your collection sorting options to behave exactly how you want them to.

We all know that first impressions matter, and how customers browse your products can make or break a sale. The default sorting options in Shopify themes are good, but sometimes, you have a specific vision in mind. This is exactly what our community member, @dreamtechzone_5, ran into.

The Challenge: Reordering Your Collection Sort Options

Imagine you’ve just launched a fantastic new line of products, and you want your customers to see the freshest items first, right at the top of your collection filters. Sounds simple, but @dreamtechzone_5 found that their "Date, new to old" option was showing up lower down in the dropdown menu, below "Most relevant." They wanted to put it front and center, above everything else.

Many merchants initially assume that changing the default sort order for a collection in the Shopify admin (under Products > Collections > [Your Collection] > Sort) will also reorder the options presented in the dropdown filter on the storefront. While the admin setting dictates which sort option is selected by default when a customer lands on a collection page, it doesn't change the display order of the options within the dropdown menu itself. This distinction is crucial and often a source of confusion.

For example, if your new arrivals are your biggest selling point, having "Date, new to old" buried beneath "Most relevant" or "Price, low to high" can hinder discovery and potentially impact sales. A customized sort order allows you to guide your customers' browsing experience, highlighting what matters most to your business strategy – whether it's newness, popularity, or specific promotions.

Why Default Isn't Always Best: Taking Control of Your Storefront

Shopify's free themes, while robust, are designed for broad applicability. This means their default functionalities, including product sorting, are generic. For stores with unique inventory cycles, marketing campaigns, or product launch strategies, these defaults can be limiting. The ability to manually reorder these options gives you granular control over your product presentation, directly influencing customer engagement and conversion rates.

This is where a little dive into your theme's Liquid code becomes necessary. Don't worry, with the right guidance, it's a manageable task that yields significant improvements in user experience.

The Solution: Diving into Liquid Code (facets.liquid)

To achieve this specific reordering, we need to modify the `facets.liquid` file within your Shopify theme. This file is responsible for rendering the collection filters and sorting options. Before you begin, always back up your theme by duplicating it in your Shopify admin (Online Store > Themes > Actions > Duplicate). This ensures you can revert to a working version if anything goes wrong.

Step-by-Step Guide to Reordering Sort Options

The solution involves strategically looping through the available sort options to render them in your desired order. We'll target both the desktop and mobile versions of the sort dropdown.

For the Desktop Version:

  1. Go to your Shopify Admin -> Online Store -> Themes.
  2. Find your current theme and click "Actions" -> "Edit code."
  3. In the "Sections" directory, search for the file named facets.liquid.
  4. Inside facets.liquid, locate the {%- for option in results.sort_options -%} {%- endfor -%}
    1. Replace the entire code block above with the following updated code. This code first sets 'created-descending' as the default, then explicitly renders it, followed by all other options (excluding 'created-ascending'), and finally 'created-ascending'.
    
    

    For the Mobile Version:

    Mobile users are just as important! We need to apply a similar logic to the mobile sorting dropdown.

    1. Still in facets.liquid, search for the {%- for option in results.sort_options -%} {%- endfor -%}
      1. Replace the entire code block above with the following updated code:
      {%- assign sort_by = results.sort_by | default: 'created-descending' -%}
      
      

      Understanding the Code Logic

      The updated code works by breaking down the single loop that Shopify typically uses to render all sort options. Instead, it uses multiple `for` loops combined with `if` and `unless` conditions to render specific options in a custom order:

      • First Loop: Specifically targets and renders 'created-descending' (Date, new to old) at the very top.
      • Second Loop: Renders all other sort options, explicitly excluding 'created-descending' and 'created-ascending', placing them in the middle section.
      • Third Loop: Renders 'created-ascending' (Date, old to new) at the bottom.

      This method ensures that "Date, new to old" is always the first option visible in the dropdown, fulfilling the original request.

      Testing and Best Practices

      After implementing these changes, it's crucial to:

      • Save your changes in the theme editor.
      • Clear your browser cache and refresh your Shopify store's collection pages.
      • Test thoroughly on both desktop and mobile devices, and across different browsers (Chrome, Firefox, Safari, Edge) to ensure the sorting options appear as intended and function correctly.
      • Verify that selecting an option actually sorts the products on the page.

      When to Seek Expert Help

      While this specific customization is achievable with direct code edits, not all theme modifications are as straightforward. If you find yourself needing more complex custom filtering logic, integrating third-party apps, or undertaking a complete platform migration to Shopify, it's often best to consult with experts. At Shopping Cart Mover, we specialize in seamless migrations and custom development, ensuring your Shopify store is not just functional, but optimized for your unique business needs.

      Conclusion

      Customizing your Shopify store's product sorting options is a powerful way to enhance the user experience and align your storefront with your business goals. By taking control of how your products are presented, you can guide customers more effectively, improve product discoverability, and ultimately drive more sales. This small but impactful change, as demonstrated by the solution for @dreamtechzone_5, shows the flexibility and power of Shopify's theme architecture when you know how to leverage it.

      Have you implemented similar customizations? Share your tips and experiences in the comments below! And if you're looking to elevate your Shopify store beyond basic settings, don't hesitate to reach out to the experts at Shopping Cart Mover for tailored solutions.

Share:

Use cases

Explore use cases

Agencies, store owners, enterprise — find the migration path that fits.

Explore use cases