ajax load only one page of search results

This commit is contained in:
Christophe Battarel
2022-04-29 09:45:36 +02:00
parent a5379043e9
commit accb900d4f

View File

@@ -48,6 +48,8 @@ $category = GETPOST('category', 'alphanohtml'); // Can be id of category or 'sup
$action = GETPOST('action', 'aZ09');
$term = GETPOST('term', 'alpha');
$id = GETPOST('id', 'int');
$search_start = GETPOST('search_start', 'int');
$search_limit = GETPOST('search_limit', 'int');
if (empty($user->rights->takepos->run)) {
accessforbidden();
@@ -232,6 +234,9 @@ if ($action == 'getProducts') {
$reshook=$hookmanager->executeHooks('printFieldListWhere', $parameters); // Note that $action and $object may have been modified by hook
$sql .= $hookmanager->resPrint;
// load only one page of products
$sql.= ' LIMIT '. $search_start . ',' . $search_limit;
$resql = $db->query($sql);
if ($resql) {
$rows = array();