Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Correct comment in get_sort_by_toggle

michaled0df7cd4b39
diff --git a/saleor/core/templatetags/shop.py b/saleor/core/templatetags/shop.py
index 7af4493a9b..ba5e8940bc 100644
--- a/saleor/core/templatetags/shop.py
+++ b/saleor/core/templatetags/shop.py
@@ -47,12 +47,14 @@ def get_sort_by_toggle(context, field):
if sort_by:
if field == sort_by:
- # enable descending sort
+ # enable ascending sort
+ # new_sort_by is used to construct a link with already toggled
+ # sort_by value
new_sort_by = u'-%s' % field
sorting_icon = static('/images/arrow_up_icon.svg')
is_active = True
else:
- # enable ascending sort
+ # enable descending sort
new_sort_by = field
if field == sort_by.strip('-'):
sorting_icon = static('/images/arrow_down_icon.svg')