We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 40238
    • 4 Posts
    Добрый день вот код Сниппет: catalog
    Он выводит список товаров, и сортирует по "ID", а я хочу чтоб сортировал по "Алфавиту", по первому столбцу "наименование" (pagetitle в таблице)
    Помогите пожалуйста. Спасибо. Только начал познавать MODX.
    Good afternoon, here's the code snippet: catalog
    It displays a list of products and sorts on the "ID", and I want to sort of "Alphabet", the first column "name" (pagetitle in the table)
    Help please. Thank you. Just started to learn MODX.
    Мой сайт: Example : http://saromat.mass.hc.ru/catalog/dlya-konditerskix-izdelij/


    <?php
    $childs = $modx->getChildIds($modx->resource->get('id'),1);
    foreach($childs as $key=>$itemId){
    echo "<table>";
    $item = $modx->getObject('modResource', $itemId);
    echo "<caption>".$item->get('pagetitle')."</caption>";
    echo "<thead><tr><th class='tr1'>Наименование</th><th class='tr2'><center>Описание</center></th><th class='tr3'>Примечание</th></tr></thead>";
    $podchilds = $modx->getChildIds($itemId, 1);
    echo "<tbody>";
    foreach($podchilds as $podkey=>$poditemId){
    $poditem = $modx->getObject('modResource', $poditemId);
    echo "<tr><td><a href='".$modx->makeUrl($poditemId)."'>".$poditem->get('pagetitle')."</a></td><td>".$poditem->getTVValue('vkus-profile')."</td><td>".$poditem->getTVValue('new');
    echo "<div class='status'>".$poditem->getTVValue('status')."</div><div class='forma'>".$poditem->getTVValue('forma')."</div></td></tr>";
    }
    echo "</tbody></table>";
    }