Warning (Click here to dismiss)
Pixel Union cannot provide support for themes modified using this guide. Support for theme modifications are best directed toward a 3rd-party development service such as Storetasker
Empire’s collection pages can display a Sort by menu that allows customers to change the order in which products appear.
By default, the available sorting options are provided by Shopify. If you want to keep the Sort by menu but remove a specific option, such as Best selling or Price, low to high, you can customize the Empire theme code.
Caution: This guide requires editing your theme code. Code customizations fall outside Pixel Union’s standard theme support. We recommend duplicating your theme before making changes. If you’re not comfortable editing Liquid code, consider working with a developer.
Before you begin
Before editing your theme code, create a backup of your current theme.
- In your Shopify admin, go to Online Store > Themes.
- Find the Empire theme you want to modify.
- Select the … menu.
- Select Duplicate.
Make the following changes to the duplicate theme first. This allows you to preview and test the customization without affecting your live storefront.
Remove the entire Sort by menu
If you want to remove the entire Sort by menu rather than an individual sorting option, you don’t need to edit your theme code.
- From your Shopify admin, go to Online Store > Themes.
- Find your Empire theme and select Edit theme.
- Open the collection template you want to edit.
- Select the Collection pages section.
- Disable the Show “Sort by” dropdown setting.
- Select Save.
If you only want to remove one or more individual sorting options, continue with the steps below.
Identify the sorting option you want to remove
Shopify assigns a value to each collection sorting option. Empire uses these values when generating the Sort by menu.
Use the following table to identify the value for the option you want to remove:
| Sorting option | Sort value |
| Featured | manual |
| Best selling | best-selling |
| Alphabetically, A–Z | title-ascending |
| Alphabetically, Z–A | title-descending |
| Price, low to high | price-ascending |
| Price, high to low | price-descending |
| Date, old to new | created-ascending |
| Date, new to old | created-descending |
For example, to remove Best selling, you’ll use:
best-sellingThe modification needs to be applied in two places because Empire displays sorting options differently depending on the customer’s device and how the Sort by interface is opened.
Edit the Empire theme code
- From your Shopify admin, go to Online Store > Themes.
- Find the duplicate Empire theme you created.
- Select the … menu.
- Select Edit code.
- Open the Snippets folder.
- Open: product-grid-sortby.liquid
You’ll find two instances of the following line:
{%- for option in collection.sort_options -%}You’ll need to modify both instances.
Update the first sorting loop
The first loop controls the standard Sort by dropdown.
Locate the first instance of:
{%- for option in collection.sort_options -%}Directly underneath it, add:
{% unless option.value == 'best-selling' %}Then locate the corresponding:
{%- endfor -%}Directly above it, add:
{% endunless %}The completed section should look similar to this:
{%- for option in collection.sort_options -%}
{% unless option.value == 'best-selling' %}
{% assign sort_active = false %}
{% if collection.sort_by == blank and collection.default_sort_by == option.value %}
{% assign sort_active = true %}
{% elsif collection.sort_by == option.value %}
{% assign sort_active = true %}
{% endif %}
<option value="{{ option.value }}" {% if sort_active %}selected="selected"{% endif %}>
{{ option.name }}
</option>
{% endunless %}
{%- endfor -%}This example removes Best selling.
To remove a different option, replace best-selling with the appropriate value from the table above.
Update the second sorting loop
Empire also generates a modal version of the sorting menu. The same modification needs to be applied to this loop so the option doesn’t continue to appear there.
Locate the second instance of:
{%- for option in collection.sort_options -%}Directly underneath it, add:
{% unless option.value == 'best-selling' %}Then locate the corresponding:
{%- endfor -%}Directly above it, add:
{% endunless %}The completed section should look similar to this:
{%- for option in collection.sort_options -%}
{% unless option.value == 'best-selling' %}
{% assign sort_active = false %}
{% if collection.sort_by == blank and collection.default_sort_by == option.value %}
{% assign sort_active = true %}
{% elsif collection.sort_by == option.value %}
{% assign sort_active = true %}
{% endif %}
{% assign button_class = 'utils-sortby--modal-button' %}
{% if sort_active %}
{% assign button_class = button_class | append: ' utils-sortby--modal-button--active' %}
{% endif %}
<li class="utils-sortby--modal-item">
<button
class="{{ button_class }}"
value="{{ option.value }}"
data-productgrid-trigger-sort-button
{% if sort_active %}
disabled
{% endif %}
>
{{ option.name }}
</button>
</li>
{% endunless %}
{%- endfor -%}Select Save when you’re finished.
Test your changes
After saving the changes, preview the duplicate theme before publishing it.
- Open a collection page containing multiple products.
- Open the Sort by menu.
- Confirm that the sorting option you removed no longer appears.
- Test the Sort by menu on both desktop and mobile.
- Select several remaining sorting options to confirm that they continue to work correctly.
- Check multiple collection pages if your store uses different collection templates.
Once you’ve confirmed everything works as expected, you can publish the updated theme.
What this customization changes
This customization removes the selected sorting option from Empire’s customer-facing Sort by menu.
It does not disable Shopify’s underlying sorting functionality or change the collection’s default sorting configuration.
For example, if a collection is configured to use Best selling as its default sorting method and you remove Best selling from the Sort by menu, the collection can still initially display products using that sorting method. Customers simply won’t see Best selling as an option they can select from the menu.
If necessary, review the collection’s default sorting settings in your Shopify admin separately.
Changes may need to be reapplied after a theme update
Custom code changes aren’t guaranteed to transfer automatically when updating to a newer version of Empire.
After updating your theme, check whether this customization is still needed and whether the relevant theme code has changed before reapplying it.
We recommend keeping a record of any customizations made to your theme so they can be reviewed after future updates.
Need help with customizations?
This modification guide is provided as an educational resource for merchants who are comfortable editing theme code.
Custom code changes, troubleshooting customizations, and maintaining modifications across theme updates fall outside Pixel Union’s standard theme support.
If you need assistance implementing or maintaining this customization, consider working with a Shopify developer or theme customization expert.