Bagisto Forum

    Bagisto

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups

    Setup Default Sort

    General Discussion
    2
    4
    427
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • D
      dan3460 last edited by

      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.

      1 Reply Last reply Reply Quote 0
      • P
        prateek-webkul last edited by

        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

        Thanks

        1 Reply Last reply Reply Quote 0
        • D
          dan3460 last edited by dan3460

          @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?

          1 Reply Last reply Reply Quote 0
          • P
            prateek-webkul last edited by

            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.

            https://github.com/bagisto/bagisto/issues/2856

            Thanks

            1 Reply Last reply Reply Quote 0
            • First post
              Last post