facets.liquid code changes show on desktop but not on mobile

facets.liquid code changes show on desktop but not on mobile

davinci2023
Visitor
2 0 0

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:

davinci2023_0-1675617913761.png

 

while this is how it looks on mobile, with still all sorting options unfortunately:

davinci2023_1-1675617973114.png

 

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!

 

Replies 0 (0)