A
A
Aleksander9112020-04-18 21:46:28
PHP
Aleksander911, 2020-04-18 21:46:28

How to sort goods in CMS Netcat?

Good day everyone.
Tell me how to sort the list of products in Netcat by quantity in reverse order?

$sort_dir = $nc_core->input->fetch_get('sortDesc')? 'DESC' : 'ASC';
$price_column = "Price";
$sorting_methods = array(
    '' => array('query_order' => "`Vendor` $sort_dir, `Name` $sort_dir", 
                'title' => 'По алфавиту', 
                'query_select' => ''),
    'price' => array('query_order' => "`__PriceRange` $sort_dir", 
                     'title' => 'По цене',
                     'query_select' => "(IF(`Price` = 0 OR `$price_column` IS NULL," .
                                            "(SELECT MIN(`$price_column`) FROM `Message$classID` AS pr WHERE pr.`Parent_Message_ID` = a.`Message_ID`), " .
                                            "`Price`)) AS `__PriceRange`"),
);

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Evgeny Petrov, 2020-04-21
@EvgenZZ

if you contacted this miracle tsms, it's better to wave your left hand and say the magic word! Warehouse of a rake, sawed a template, wrote Rest separately, sewed Vue in the end, spat, wherever you dig mistakes, a miracle code written in from---s. Learn worthy cms.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question