From b96c3d0df32fec3fc341e58c9bcc3609184f863d Mon Sep 17 00:00:00 2001 From: David Beniamine Date: Wed, 9 Apr 2025 16:01:48 +0200 Subject: [PATCH] Take into account subcategories shown to get product offset (#33788) --- htdocs/takepos/index.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php index 181e4df764f..eee65213689 100644 --- a/htdocs/takepos/index.php +++ b/htdocs/takepos/index.php @@ -469,7 +469,8 @@ function MoreProducts(moreorless) { if (maxproduct >= 1) { limit = maxproduct-1; } - var offset = * pageproducts; + var nb_cat_shown = $('.div5 div.wrapper2[data-iscat=1]').length; + var offset = * pageproducts - nb_cat_shown; // Only show products for sale (tosell=1) $.getJSON('/takepos/ajax/ajax.php?action=getProducts&token=&category='+currentcat+'&tosell=1&limit='+limit+'&offset='+offset, function(data) { console.log("Call ajax.php (in MoreProducts) to get Products of category "+currentcat);