Shopify themes, liquid, logos, and UX
Hi,
How can I put "Latest Arrivals" option on the very top of the sort by dropdown menu?
I'm using Dawn theme.
Thank you so much for your help in advance!
Website: https://vintage.kyoto/
Password: kvw2525
Hi @Ulalala ,
You can follow these steps:
Step 1: Go to admin -> Themes -> Edit code
Step 2: Find the theme.liquid file and base.css file
Add this code near the end of the theme.liquid file before the </body> tag
<script> let sortEl = document.querySelectorAll("select[name='sort_by']") sortEl.forEach((sortItem) => { sortItem.addEventListener("click", function () { let elementsSort = Array.from(sortItem.children); elementsSort.reverse(); sortItem.innerHTML = ''; elementsSort.forEach(function(element) { sortItem.appendChild(element); }); }) }) </script>
This CSS code goes at the end of the base.css file:
select#SortBy > option { background-color: #ffffff !important; }
Result: https://www.loom.com/share/ede9a838a24349ab94f16a2b7e8c4ccf?sid=68692547-c51e-4659-92ab-8971809781b7
Hope it helps @Ulalala
If our suggestions are useful, please let us know by giving it a like, marking it as a solution, or donating here ☕.
B2B Solution & Custom Pricing | Product Labels by BSS
Need help from our expert? Kindly share your request with us via community@bsscommerce.com
By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024Thanks to everyone who participated in our AMA with 2H Media: Marketing Your Shopify St...
By Jacqui Sep 6, 2024