Commit 1eaab8b24a27d879f18f0047091c9deb891cbfb3
1 parent
4ee7051b
Sorting
Showing
1 changed file
with
13 additions
and
1 deletions
Show diff stats
frontend/controllers/CategoryController.php
| @@ -51,7 +51,16 @@ | @@ -51,7 +51,16 @@ | ||
| 51 | 'pageSize' => 18, | 51 | 'pageSize' => 18, |
| 52 | ], | 52 | ], |
| 53 | 'sort' => [ | 53 | 'sort' => [ |
| 54 | - 'attributes' => [ | 54 | + 'attributes' => [ |
| 55 | + 'relevant' => [ | ||
| 56 | + 'asc' => [ | ||
| 57 | + 'product.id' => SORT_DESC, | ||
| 58 | + ], | ||
| 59 | + 'desc' => [ | ||
| 60 | + 'product.id' => SORT_DESC, | ||
| 61 | + ], | ||
| 62 | + 'label' => \Yii::t('app', 'по умолчанию'), | ||
| 63 | + ], | ||
| 55 | 'title_asc' => [ | 64 | 'title_asc' => [ |
| 56 | 'asc' => [ | 65 | 'asc' => [ |
| 57 | 'product_lang.title' => SORT_ASC, | 66 | 'product_lang.title' => SORT_ASC, |
| @@ -89,6 +98,9 @@ | @@ -89,6 +98,9 @@ | ||
| 89 | 'label' => \Yii::t('app', 'по цене по убыванию'), | 98 | 'label' => \Yii::t('app', 'по цене по убыванию'), |
| 90 | ], | 99 | ], |
| 91 | ], | 100 | ], |
| 101 | + 'defaultOrder' => [ | ||
| 102 | + 'relevant' => SORT_DESC, | ||
| 103 | + ], | ||
| 92 | ], | 104 | ], |
| 93 | ] | 105 | ] |
| 94 | ); | 106 | ); |