We use cookies to make your experience better. To comply with the new e-Privacy directive, we need to ask for your consent to set the cookies. Learn more.
Change Default Category Sort Order
Would you like to change the default category sort order from ascending to descending? Let's see how you can easily do that by just changing the category layout.
So you can simply create an xml file under your theme folder like in the path app/design/frontend/<Vendor>/<Theme>/Magento_Catalog/layout/catalog_category_view.xml and add the code below.
As you can see we pass a string as argument to the function setDefaultDirection, which has the value of 'desc'. Now the products on the catalog product page are sorted descending.
Feel free to share this post and ask your questions in the comments below.
Till next time!