Hello, I am developing a website to receive orders from several prestashop.
I bring the orders from php with;
$ opt = [ 'resource' => 'orders', 'display' => '[id, reference, total_paid, id_customer, id_cart, id_address_delivery, current_state, payment, date_add]', 'sort' => '[id_DESC]', 'limit' => '10' ]; $ xml = $ webService-> get ($ opt); $ resources = $ xml-> orders-> children ();
I have tried to change the sort to "date_add_DESC" but it does not return anything.
I have thought about ordering the array when I have filled it with php's usort () function,
usort($ArrayPedidos, function ($a, $b) { return strcmp($a["fecha"], $b["fecha"]); });
but I can't, any help would be good for me. thanks.