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 = [];
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(){
getInfoFromSelectedProduct().done(function(response, status){
totalPrice = 0;

View File

@ -31,12 +31,6 @@ $(window).on('load', function(){
$('#total-price').parent().parent().parent().show();
$('#no-products').hide();
$('#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{
$('.cart-link').hide();
$(".btn-share").hide();
@ -45,12 +39,6 @@ $(window).on('load', function(){
$('#total-price').parent().parent().parent().hide();
$('#no-products').show();
$('#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){