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(); + } }); }