New filter products for sale

This commit is contained in:
VESSILLER 2023-03-20 13:27:48 +01:00
parent d523f91a29
commit daa34b85fe
2 changed files with 2 additions and 2 deletions

View File

@ -850,7 +850,7 @@ class Categorie extends CommonObject
* @return array|int -1 if KO, array of instance of object if OK
* @see containsObject()
*/
public function getObjectsInCateg($type, $onlyids = 0, $limit = 0, $offset = 0, $sortfield = '', $sortorder = 'ASC')
public function getObjectsInCateg($type, $onlyids = 0, $limit = 0, $offset = 0, $sortfield = '', $sortorder = 'ASC', $filter = array(), $filtermode = 'AND')
{
global $user;

View File

@ -78,7 +78,7 @@ if ($action == 'getProducts') {
if ($tosell != '') {
$filter = array('customsql' => 'o.tosell = '.((int) $tosell));
}
$prods = $object->getObjectsInCateg("product", 0, $limit, $offset, getDolGlobalString('TAKEPOS_SORTPRODUCTFIELD'), 'ASC');
$prods = $object->getObjectsInCateg("product", 0, $limit, $offset, getDolGlobalString('TAKEPOS_SORTPRODUCTFIELD'), 'ASC', $filter);
// Removed properties we don't need
$res = array();
if (is_array($prods) && count($prods) > 0) {