Skip to content
Permalink
Browse files

Improve: scanning barcodes multiple times

  • Loading branch information...
kilbot committed Aug 26, 2015
1 parent 35f547c commit 670173b4e890d74800420511803e48ef9f6a4ec7
Showing with 18 additions and 8 deletions.
  1. +12 −3 assets/js/src/apps/pos/products/views/actions.js
  2. +4 −4 assets/js/src/entities/products/model.js
  3. +2 −1 readme.txt
@@ -8,9 +8,18 @@ var Actions = View.extend({
template: '#tmpl-products-filter',

initialize: function(){
var products = this.collection.superset();
this.listenTo(products, 'match:barcode', function(model){
this.triggerMethod('clear');
var products = this.collection;
var self = this;

/**
* match:barcode is triggered before filter is complete
* this affects the filtered collection pagination
* todo: refactor and fix this
*/
this.listenTo(products.superset(), 'match:barcode', function(model){
products.once('paginated:change:page', function(){
self.triggerMethod('clear');
});
Radio.request('router', 'add:to:cart', model);
});
},
@@ -68,12 +68,12 @@ module.exports = DualModel.extend({

}, this);

if(match){
return match;
}
//if(match){
// return match;
//}

// the original matchMaker
return callback(tokens, this);
return match ? match : callback(tokens, this);

},

@@ -78,7 +78,8 @@ Bugs can be reported on the [WooCommerce POS GitHub repository](https://github.c
== Changelog ==

= 0.4.4 =
* Fix: cart totals going to zero with new fee or shipping line item - commit []()
* Fix: cart totals going to zero with new fee or shipping line item - commit [35f547c](https://github.com/kilbot/WooCommerce-POS/commit/35f547cf40919736ff769702043489ff1698ec30)
* Improve: scanning barcodes multiple times - commit []()

= 0.4.3 =
* Fix: barcode scanning bug introduced in version 0.4.2 - commit [8a608c8](https://github.com/kilbot/WooCommerce-POS/commit/8a608c8124d77cd3499af55e08651752287261bc)

0 comments on commit 670173b

Please sign in to comment.
You can’t perform that action at this time.