Skip to content

Commit

Permalink
Sort products by reference
Browse files Browse the repository at this point in the history
  • Loading branch information
dbeniamine committed Nov 29, 2019
1 parent 425f880 commit 828aa9b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions htdocs/takepos/ajax.php
Expand Up @@ -46,6 +46,10 @@
$object = new Categorie($db);
$result=$object->fetch($category);
$prods = $object->getObjectsInCateg("product");
function sort_by_ref($a, $b) {
return strcmp($a->ref, $b->ref);
}
usort($prods, "sort_by_ref");
echo json_encode($prods);
}
elseif ($action=="search" && $term != '') {
Expand Down

0 comments on commit 828aa9b

Please sign in to comment.