master
parent
47bdb8f45c
commit
a557e17586
|
@ -131,7 +131,6 @@
|
||||||
$('#list-products-in-bag').html('');
|
$('#list-products-in-bag').html('');
|
||||||
totalPrice = 0;
|
totalPrice = 0;
|
||||||
if(objProducts.length > 0) {
|
if(objProducts.length > 0) {
|
||||||
$('#count-products-in-bag').show();
|
|
||||||
let ids = objProducts.map(obj => obj.id);
|
let ids = objProducts.map(obj => obj.id);
|
||||||
$.get($('meta[name="get-contents"]').attr('content')+"/"+ids.join(","), function(response, status){
|
$.get($('meta[name="get-contents"]').attr('content')+"/"+ids.join(","), function(response, status){
|
||||||
response.contents.forEach(function(item){
|
response.contents.forEach(function(item){
|
||||||
|
@ -162,13 +161,14 @@
|
||||||
});
|
});
|
||||||
$('#total-price').text(formatter.format(totalPrice));
|
$('#total-price').text(formatter.format(totalPrice));
|
||||||
});
|
});
|
||||||
|
$('#count-products-in-bag').show();
|
||||||
$('#list-products-in-bag').parent().parent().parent().parent().parent().find('.modal-footer').show();
|
$('#list-products-in-bag').parent().parent().parent().parent().parent().find('.modal-footer').show();
|
||||||
$('#total-price').parent().parent().parent().show();
|
$('#total-price').parent().parent().parent().show();
|
||||||
$('#no-products').hide();
|
$('#no-products').hide();
|
||||||
}else {
|
}else {
|
||||||
|
$('#count-products-in-bag').hide();
|
||||||
$('#list-products-in-bag').parent().parent().parent().parent().parent().find('.modal-footer').hide();
|
$('#list-products-in-bag').parent().parent().parent().parent().parent().find('.modal-footer').hide();
|
||||||
$('#total-price').parent().parent().parent().hide();
|
$('#total-price').parent().parent().parent().hide();
|
||||||
$('#count-products-in-bag').hide();
|
|
||||||
$('#no-products').show();
|
$('#no-products').show();
|
||||||
}
|
}
|
||||||
$('#total-price').text(formatter.format(totalPrice));
|
$('#total-price').text(formatter.format(totalPrice));
|
||||||
|
|
|
@ -203,8 +203,8 @@
|
||||||
console.log(addressComponents);
|
console.log(addressComponents);
|
||||||
$('#street-number').val(getAddressFiedlValue(addressComponents, 'street_number'));
|
$('#street-number').val(getAddressFiedlValue(addressComponents, 'street_number'));
|
||||||
$('#route').val(getAddressFiedlValue(addressComponents, 'route'));
|
$('#route').val(getAddressFiedlValue(addressComponents, 'route'));
|
||||||
$('#sublocality-level-1').val(getAddressFiedlValue(addressComponents, 'locality'));
|
$('#sublocality-level-1').val(getAddressFiedlValue(addressComponents, 'sublocality_level_1'));
|
||||||
$('#locality').val(getAddressFiedlValue(addressComponents, 'street_number'));
|
$('#locality').val(getAddressFiedlValue(addressComponents, 'locality'));
|
||||||
$('#administrative-area-level-3').val(getAddressFiedlValue(addressComponents, 'administrative_area_level_3'));
|
$('#administrative-area-level-3').val(getAddressFiedlValue(addressComponents, 'administrative_area_level_3'));
|
||||||
$('#administrative-area-level-2').val(getAddressFiedlValue(addressComponents, 'administrative_area_level_2'));
|
$('#administrative-area-level-2').val(getAddressFiedlValue(addressComponents, 'administrative_area_level_2'));
|
||||||
$('#administrative-area-level-1').val(getAddressFiedlValue(addressComponents, 'administrative_area_level_1'));
|
$('#administrative-area-level-1').val(getAddressFiedlValue(addressComponents, 'administrative_area_level_1'));
|
||||||
|
|
Loading…
Reference in New Issue