A
A
Alexander Ivanov2016-05-30 13:55:48
MODX
Alexander Ivanov, 2016-05-30 13:55:48

How to organize sorting in pdoPage?

Last year I already solved this problem now I can’t remember what I did at all.
The essence of the problem:
it sorts the
subcategory
100 rubles.
102 rub.
103 rub.
subcategory
99 rub.
100 rub.
subcategory
88 rub.
100 rub.
How to make subcategories not affect sorting?
those. so
88 rubles.
99 rub.
100 rub.
102 rub.
103 rub.
I bring it out like this


Spippet of sorter
$sort = $_GET['sort'];
if($sort == '') {
    $output='&sortby=`{"editedon":"DESC"}`';
} else {
    $output = '&sortby=`{"'.$sort.'":"'.$_GET['dir'].'"}`';
}
return $output;

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Ivanov, 2016-05-30
@cimonlebedev

Figured out the answer, found it in old questions, I was stupid, the price should have had a price type and not a text

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question