Hello guys,
I really don't understand this new problem in Javascript.
I'm in the javascript function update_payment_summary in the point of sale.
This one works well :
var currentOrder = this.pos.get('selectedOrder');
var plines = currentOrder.get('paymentLines').models;
for (var i = 0; i < plines.length; i++) {
var message = plines[i].get_type();
console.log('payment_method ' + message +' et le i est : ' + i);
}
The log displays : "payment_method cash et le i est : 0"
This one doesn't work ??????? :
var currentOrder = this.pos.get('selectedOrder');
var plines = currentOrder.get('paymentLines').models;
var i = 0;
var message = plines[i].get_type();
console.log('payment_method ' + message +' et le i est : ' + i); }
I get this error : TypeError: plines[i] is undefined
I'm crazy or what?
Thanks to help