Skip to content

Commit

Permalink
cherry-pick: Add visible and visible_reverse values in Product Loop o…
Browse files Browse the repository at this point in the history
…rder argument thelia#1939
  • Loading branch information
Baixas Alban authored and gillesbourgeat committed Apr 28, 2016
1 parent c9b0a21 commit 0280830
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
@@ -1,5 +1,6 @@
# 2.2.3

- (related to #1939) Add `visible` and `visible_reverse` values in Product Loop order argument
- (related to #1936) Fixed the module name vefication for command `module:position`
- (related to #1928) Hook DI alert messages thrown as exceptions in dev. mode
- (related to #1921) Modules 'configuration' and 'hook' buttons behavior fix
Expand Down
7 changes: 7 additions & 0 deletions core/lib/Thelia/Core/Template/Loop/Product.php
Expand Up @@ -89,6 +89,7 @@ protected function getArgDefinitions()
'created', 'created_reverse',
'updated', 'updated_reverse',
'ref', 'ref_reverse',
'visible', 'visible_reverse',
'promo',
'new',
'random',
Expand Down Expand Up @@ -973,6 +974,12 @@ public function buildModelCriteria()
case "ref_reverse":
$search->orderByRef(Criteria::DESC);
break;
case "visible":
$search->orderByVisible(Criteria::ASC);
break;
case "visible_reverse":
$search->orderByVisible(Criteria::DESC);
break;
case "promo":
if ($complex) {
$search->addDescendingOrderByColumn('main_product_is_promo');
Expand Down

0 comments on commit 0280830

Please sign in to comment.