L
L
lexstile2017-08-02 16:39:33
1C-Bitrix
lexstile, 2017-08-02 16:39:33

How to set sorting in catalog.section.list by id in forward or reverse order?

Tried:

//ORDER BY
  $arSort = array(
    "left_margin"=>"id",
  );

Does not work

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Nikolaev, 2017-08-02
@lexstile

$arSort is an associative array for sorting the value, in the format "Field ID" => "Order".
Moreover, the order can only be ASC (ascending) or DESC (descending)
In your case, it should be like this:

$arSort = array(
  "LEFT_MARGIN" => "ASC",
);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question