From 21e5aa5fa59a8b263d9d2f89702db0db91bb3fca Mon Sep 17 00:00:00 2001 From: Ashkar Date: Wed, 16 Apr 2025 20:49:21 +0530 Subject: [PATCH] fix: automatic item add --- posnext/public/js/pos_item_selector.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/posnext/public/js/pos_item_selector.js b/posnext/public/js/pos_item_selector.js index 6053dda..d403296 100644 --- a/posnext/public/js/pos_item_selector.js +++ b/posnext/public/js/pos_item_selector.js @@ -813,6 +813,10 @@ posnext.PointOfSale.ItemSelector = class { this.items = items; this.render_item_list(items); this.auto_add_item && this.items.length == 1; + // Automatically add item to cart if only one item is found + if (this.items.length === 1) { + this.add_filtered_item_to_cart(); + } return; } } @@ -827,6 +831,10 @@ posnext.PointOfSale.ItemSelector = class { this.items = items; this.render_item_list(items); this.auto_add_item && this.items.length == 1; + // Automatically add item to cart if only one item is found + if (this.items.length === 1) { + this.add_filtered_item_to_cart(); + } }); }