| Line 14... |
Line 14... |
| 14 |
var totalCartValue = cartDetailsObj.totalCartValue;
|
14 |
var totalCartValue = cartDetailsObj.totalCartValue;
|
| 15 |
var priceChangeMap = {};
|
15 |
var priceChangeMap = {};
|
| 16 |
$.each(cartDetailsObj.cartItems, function(key,val) {
|
16 |
$.each(cartDetailsObj.cartItems, function(key,val) {
|
| 17 |
var newUnitPrice = $(".number-spinner button[data-id='"+key+"']").data('price');
|
17 |
var newUnitPrice = $(".number-spinner button[data-id='"+key+"']").data('price');
|
| 18 |
var bulkpricing = $(".number-spinner button[data-id='"+key+"']").data('bulkpricing');
|
18 |
var bulkpricing = $(".number-spinner button[data-id='"+key+"']").data('bulkpricing');
|
| 19 |
if (bulkpricing != undefined && bulkpricing.length > 1){
|
19 |
if (typeof bulkpricing != undefined && bulkpricing.length != 0){
|
| 20 |
// bulkpricing = bulkpricing.sort(function(a, b){
|
20 |
// bulkpricing = bulkpricing.sort(function(a, b){
|
| 21 |
// return a.quantity - b.quantity;
|
21 |
// return a.quantity - b.quantity;
|
| 22 |
// });
|
22 |
// });
|
| 23 |
|
23 |
|
| 24 |
|
24 |
|
| Line 178... |
Line 178... |
| 178 |
totalCartQuantity = totalCartQuantity - dec;
|
178 |
totalCartQuantity = totalCartQuantity - dec;
|
| 179 |
}
|
179 |
}
|
| 180 |
|
180 |
|
| 181 |
btn.closest('.number-spinner').find('input').val(newVal);
|
181 |
btn.closest('.number-spinner').find('input').val(newVal);
|
| 182 |
|
182 |
|
| 183 |
if (bulkpricing != undefined && bulkpricing.length > 1){
|
183 |
if (typeof bulkpricing != undefined && bulkpricing.length != 0){
|
| 184 |
bulkpricing = bulkpricing.sort(function(a, b){
|
184 |
// bulkpricing = bulkpricing.sort(function(a, b){
|
| 185 |
return a.quantity - b.quantity;
|
185 |
// return a.quantity - b.quantity;
|
| 186 |
});
|
186 |
// });
|
| 187 |
|
187 |
|
| 188 |
if(newVal == 0){
|
188 |
if(newVal == 0){
|
| 189 |
$(this).parent().parent().parent().parent().find('.setback').removeClass('setback');
|
189 |
$(this).parent().parent().parent().parent().find('.setback').removeClass('setback');
|
| 190 |
// $(this).parent().parent().parent().parent().find('.select'+sku+'a'+bulkpricing[0]['quantity']).addClass('setback');
|
190 |
// $(this).parent().parent().parent().parent().find('.select'+sku+'a'+bulkpricing[0]['quantity']).addClass('setback');
|
| 191 |
}
|
191 |
}
|