Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Hi, I changed the facets.liquid code in order to customize the sorting options in the collection page within Dawn theme. I reduced the sorting options from 8 to 5. However the changes properly show in the desktop version but don't seem to affect to mobile version. How can i fix that so that it applies for both, desktop and mobile?
Here is what I did:
Within facets.liquid i went to line 319 and removed the following part:
<select name="sort_by" class="facet-filters__sort select__select caption-large" id="SortBy" aria-describedby="a11y-refresh-page-message">
{%- for option in collection.sort_options -%}
<option value="{{ option.value | escape }}"{% if option.value == sort_by %} selected="selected"{% endif %}>{{ option.name | escape }}</option>
{%- endfor -%}
</select>
and exchanged it with the following:
select name="sort_by" class="facet-filters__sort select__select caption-large" id="SortBy" aria-describedby="a11y-refresh-page-message">
<option value="title-ascending">Alphabetically, A-Z</option>
<option value="title-descending">Alphabetically, Z-A</option>
<option value="price-ascending" {% if 'price-ascending' == sort_by %}selected="selected"{% endif %}>Price, low to high</option>
<option value="price-descending" {% if 'price-descending' == sort_by %}selected="selected"{% endif %}>Price, high to low</option>
<option value="best-selling" {% if 'best-selling' == sort_by %}selected="selected"{% endif %}>Best selling</option>
</select>
And this is the correct result on desktop:
while this is how it looks on mobile, with still all sorting options unfortunately:
Do i have to add something to the code to make it apply to mobile as well, or do i have to replace the code in a different place as well?
Please help me out here and thanks for your time in advance. Much appreciated!
In Canada, payment processors, like those that provide payment processing services t...
By Jacqui Mar 14, 2025Unlock the potential of marketing on your business growth with Shopify Academy's late...
By Shopify Mar 12, 2025Learn how to increase conversion rates in every stage of the customer journey by enroll...
By Shopify Mar 5, 2025