In product list page I need to change the sorting order. I have a current order like:
- Description A-Z
- Price High To Low
- Price Low to High
- Description Z-A
I need to change it to.
- Description A-Z
- Description Z-A
- Price High To Low
- Price Low to High
I tried using this JS.
window.onload = () => {
const fontMenu = document.querySelector("#sorter");
const options = Array.from(fontMenu.querySelectorAll("option"));
// options.reverse();
options.forEach((item,o) => {
options.splice(0,3);
console.log(options,'op')
options.unshift(item);
fontMenu.appendChild(item);
});
}