Skip to content

Commit

Permalink
Merge pull request #2458 from roadster31/brand-fix
Browse files Browse the repository at this point in the history
Fixed brand sorting by "visible" status
  • Loading branch information
roadster31 committed Dec 12, 2017
2 parents 3fef289 + 948f2f5 commit 9ce8246
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
10 changes: 9 additions & 1 deletion core/lib/Thelia/Core/Template/Loop/Brand.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -78,7 +78,9 @@ protected function getArgDefinitions()
'created', 'created',
'created-reverse', 'created-reverse',
'updated', 'updated',
'updated-reverse' 'updated-reverse',
'visible',
'visible-reverse'
) )
) )
), ),
Expand Down Expand Up @@ -197,6 +199,12 @@ public function buildModelCriteria()
case "updated-reverse": case "updated-reverse":
$search->addDescendingOrderByColumn('updated_at'); $search->addDescendingOrderByColumn('updated_at');
break; break;
case "visible":
$search->orderByVisible(Criteria::ASC);
break;
case "visible-reverse":
$search->orderByVisible(Criteria::DESC);
break;
} }
} }


Expand Down
4 changes: 2 additions & 2 deletions templates/backOffice/default/brands.html
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@


<th class="text-center"> <th class="text-center">
{admin_sortable_header {admin_sortable_header
current_order=$content_order current_order=$order
order='visible' order='visible'
reverse_order='visible-reverse' reverse_order='visible-reverse'
path={url path='/admin/brand'} path={url path='/admin/brand'}
Expand Down Expand Up @@ -313,4 +313,4 @@


{block name="javascript-last-call"} {block name="javascript-last-call"}
{hook name='brand.js' location='brand_js'} {hook name='brand.js' location='brand_js'}
{/block} {/block}

0 comments on commit 9ce8246

Please sign in to comment.