Hi all,
I’m coostumizing Dawn Theme, and I’ve ran into a problem:
I’d like to remove some of the options within “sort by”…
I only like to keep ascending price and decending price and remove the others…
My collection: to the page
anyone know how to do this?
Thanks in advance,
Andy
Hi @larsvilhelmsson
Please follow these steps:
-
Go to Online Store
-
Click edit code
-
Find your theme.liquid file
-
Add the following code in the bottom of the file above tag
This will hide all the sort by options except for ascending price and descending price.
Hope this helps 
Kind Regards,
Futuremerce
Hi @larsvilhelmsson , I hope you are doing well.
- Go to Online Store → Theme → Edit code.
- Open your theme.liquid file
- In theme.liquid, paste the below code before
/* Hide all sorting options initially*/
select[name="sort-by"] option {
display: none;
}
/* Show only the Ascending price and Descending price options */
select[name="sort-by"] option[value="price-ascending"],
select[name="sort-by"] option[value="price-descending"] {
display: block;
}
If my reply is helpful, kindly click like and mark it as an accepted solution.
Thanks!
Hello @larsvilhelmsson
Go to online store ---------> themes --------------> actions ------> edit code------->assets-----> component-facets.css
add this code at the end of the file.
.facet-filters__sort div:nth-child(1),.facet-filters__sort div:nth-child(2),.facet-filters__sort div:nth-child(3),.facet-filters__sort div:nth-child(4),.facet-filters__sort div:nth-child(7),.facet-filters__sort div:nth-child(8).facet-filters__sort div:nth-child(1), .facet-filters__sort div:nth-child(2), .facet-filters__sort div:nth-child(3), .facet-filters__sort div:nth-child(4), .facet-filters__sort div:nth-child(7), .facet-filters__sort div:nth-child(8) {
display: none;
}
result
If this was helpful, hit the like button and accept the solution.
Thanks
Amzing! Thanks for the help, this worked!
Thanks a lot…!!!
Please hit the like button also.
Hi can I request to keep he ‘Featured’, ‘Best seller’, ‘Newest first’, and ‘Oldest first’ instead on the coding and remove the price <> and the alphabetical?
This works for me, but the dropdown label is one of the hidden options. How do I change it?