- this.get('orderLines').each(function(item){
- var line = item.export_as_JSON();
- if( typeof resume[line.product_id] === 'undefined'){
- resume[line.product_id] = line.qty;
- }else{
- resume[line.product_id] += line.qty;
+
+ this.orderlines.each(function(line){
+ var line_hash = line.get_line_diff_hash();
+ var qty = Number(line.get_quantity());
+ var note = line.get_note();
+ var product_id = line.get_product().id;
+
+ if (typeof resume[line_hash] === 'undefined') {
+ resume[line_hash] = { qty: qty, note: note, product_id: product_id };
+ } else {
+ resume[line_hash].qty += qty;