Пытаюсь релизовать сортировку товаров выводимых через pdoPage. Но сортировка указываемая в GET параметре не применяется
Вывод идет так:
{'!pdoPage' | snippet : [
'parents' => $_modx->resource.id,
'limit' => 9,
'hideContainers' => true,
'includeTVs' => 'image,price,old_price',
'tplPageWrapper' => '@INLINE {include "file:inc/pager.wrap.tpl"}'
'tplPageActive' => '@INLINE {include "file:inc/pager.page.active.tpl"}',
'tvPrefix' => '',
'tpl' => '@INLINE
<div class="column">
{include "file:inc/catalog/product.tpl"}
</div>
'
$modx->runSnippet('!Sort')
]}
Снипет Sort:
<?php
$sort = $_GET['sort'];
if($sort == '') {
$output='&sortby=`{"menuindex":"ASC"}`';
} else {
$output = '&sortby=`{"'.$sort.'":"'.$_GET['dir'].'"}`';
}
return $output;
Пример ссылок:
<nav>
<span>Сортировать по:</span>
<a href="/vesyi-i-shagomeryi/vesyi-elektronnyie/?
sort=pagetitle&dir=DESC">Названию</a>
<a up="" href="/vesyi-i-shagomeryi/vesyi-elektronnyie/?
sort=price&dir=DESC">По цене</a>
</nav>