Gustavo Luigi 2022-09-07 15:02:32 +02:00
parent e16822912c
commit 3f981767f9
2 changed files with 13 additions and 12 deletions

View File

@ -57,6 +57,19 @@ $(window).on('load', function(){
objProducts = []; objProducts = [];
localStorage.setItem("products", JSON.stringify(objProducts)); localStorage.setItem("products", JSON.stringify(objProducts));
}); });
$(document).on('click', '.btn-remove-product', function(){
if(objProducts.length > 0){
$('#form-section').show();
$('#list-products').parent().parent().parent().parent().parent().find('.modal-footer').show();
$('#total-checkout-price').parent().parent().parent().show();
$('#no-products-in-checkout').hide();
}else{
$('#form-section').hide();
$('#list-products').parent().parent().parent().parent().parent().find('.modal-footer').hide();
$('#total-checkout-price').parent().parent().parent().hide();
$('#no-products-in-checkout').show();
}
});
$(document).on('input', '.select-quantity', function(){ $(document).on('input', '.select-quantity', function(){
getInfoFromSelectedProduct().done(function(response, status){ getInfoFromSelectedProduct().done(function(response, status){
totalPrice = 0; totalPrice = 0;

View File

@ -31,12 +31,6 @@ $(window).on('load', function(){
$('#total-price').parent().parent().parent().show(); $('#total-price').parent().parent().parent().show();
$('#no-products').hide(); $('#no-products').hide();
$('#modal-buttons').show(); $('#modal-buttons').show();
if(typeof updateProducts === "function"){
$('#form-section').show();
$('#list-products').parent().parent().parent().parent().parent().find('.modal-footer').show();
$('#total-checkout-price').parent().parent().parent().show();
$('#no-products-in-checkout').hide();
}
}else{ }else{
$('.cart-link').hide(); $('.cart-link').hide();
$(".btn-share").hide(); $(".btn-share").hide();
@ -45,12 +39,6 @@ $(window).on('load', function(){
$('#total-price').parent().parent().parent().hide(); $('#total-price').parent().parent().parent().hide();
$('#no-products').show(); $('#no-products').show();
$('#modal-buttons').hide(); $('#modal-buttons').hide();
if(typeof updateProducts === "function"){
$('#form-section').hide();
$('#list-products').parent().parent().parent().parent().parent().find('.modal-footer').hide();
$('#total-checkout-price').parent().parent().parent().hide();
$('#no-products-in-checkout').show();
}
} }


getInfoFromSelectedProduct().done(function(response, status){ getInfoFromSelectedProduct().done(function(response, status){