# How to add new sorting methods?

**URL:** <https://forum.shopware.com/t/how-to-add-new-sorting-methods/51298>\
**Category:** International (English Only)\
**Tags:** general\
**Created:** [21. Februar 2018 um 19:32 UTC](https://forum.shopware.com/t/how-to-add-new-sorting-methods/51298 "2018-02-21T19:32:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![amr](https://avatars.discourse-cdn.com/v4/letter/a/73ab20/32.png) [@amr](https://forum.shopware.com/u/amr)\
**Post date:** [21. Februar 2018 um 19:32 UTC](https://forum.shopware.com/t/how-to-add-new-sorting-methods/51298/1 "2018-02-21T19:32:19Z")

</div>

Hello!

I am trying to add a new sorting method to the products sortin menu.  
 ![](https://europe1.discourse-cdn.com/flex013/uploads/shopware/original/2X/3/3d92898189453619555d35c69ba4c7d4a21f496a.png)

I want to sort the items by sales.

in the backend:  
&nbsp; &nbsp;&nbsp; **Basic settings \> Frontend \> Filter / Sorting**

there is only some default sorting methods

Is there a possible way&nbsp;to define new ones?

Thank you!

---

<div class="post-metadata">

**Author:** ![jonathan](https://avatars.discourse-cdn.com/v4/letter/j/aeb1de/32.png) [@jonathan](https://forum.shopware.com/u/jonathan)\
**Post date:** [21. Februar 2018 um 19:37 UTC](https://forum.shopware.com/t/how-to-add-new-sorting-methods/51298/2 "2018-02-21T19:37:07Z")

</div>

Custom sorting is limited to the predifined fields in standard. It is possible to create new sortings (click: “Add Item” - Shopware 5.3+).

We created this plugin for using individual fields & SQL-Queries: [http://store.shopware.com/colo328219905291/individuelle-kategoriesortierung-datenbankfelder-sql-queries.html](http://store.shopware.com/colo328219905291/individuelle-kategoriesortierung-datenbankfelder-sql-queries.html)

🙂

---

<div class="post-metadata">

**Author:** ![amr](https://avatars.discourse-cdn.com/v4/letter/a/73ab20/32.png) [@amr](https://forum.shopware.com/u/amr)\
**Post date:** [21. Februar 2018 um 21:12 UTC](https://forum.shopware.com/t/how-to-add-new-sorting-methods/51298/3 "2018-02-21T21:12:51Z")

</div>

Thank you!  
But isn’t there any programmatic way to do it or any guide?

---

<div class="post-metadata">

**Author:** ![jonathan](https://avatars.discourse-cdn.com/v4/letter/j/aeb1de/32.png) [@jonathan](https://forum.shopware.com/u/jonathan)\
**Post date:** [21. Februar 2018 um 22:01 UTC](https://forum.shopware.com/t/how-to-add-new-sorting-methods/51298/4 "2018-02-21T22:01:31Z")

</div>

Sure! You can find the standard sortings here: [shopware/engine/Shopware/Bundle/SearchBundleDBAL/SortingHandler at 56df57575909854d2dec7fcba07500e27a3361ee · shopware/shopware · GitHub](https://github.com/shopware/shopware/tree/56df57575909854d2dec7fcba07500e27a3361ee/engine/Shopware/Bundle/SearchBundleDBAL/SortingHandler)

You can use the logic to implement a custom one. 🙂
