Recent Topics

Setup Default Sort

  • On the product pages there is a sort drop down which shows by default "Newest First". I need to have that sorting been alphabetical as default. Where can i change that?

    Thanks for the help.

  • Hey dan3460,

    • Go to "packages/Webkul/Product/src/Helpers/Toolbar.php" and search for method isOrderCurrent();

    • Within elseif condition i.e., elseif (! isset($params['sort']) && $key == 'name-asc') , you need to pass key as for default sort display ,bydefault it is Newest first,

    • You may get keys in same file in getAvailableOrders() function, for example: to set From A-Z you need to set key to name-asc


  • @prateek-webkul Thanks for the answer. I did change the condition on the Toolbar.php but the product view still show the product newest first even though the button on top says A-Z. As you said in your answer the default is set as Newest first. How do i change the default to be a-z?

  • Hey @dan3460 ,

    There is an issue in filter sort by, which is raised issue on bagisto respository. We are working on it and you can get any update on below link.


Log in to reply