Compare commits

..

No commits in common. "dd7f6b8ccd29a38a3cdc77bd6e37be9a185ba379" and "8cfe55d350caeb775c8d52e93a0247f839be000a" have entirely different histories.

1 changed files with 2 additions and 3 deletions

View File

@ -160,8 +160,7 @@
$('#total-price').text(formatter.format(totalPrice));
let productId = $('meta[name="product-id"]').attr('content');
if(productId != undefined){
let objProductInfo = objProducts.find(obj => obj.id == productId);
if(objProductInfo == undefined) {
if(objProducts.find(obj => obj.id == productId) == undefined) {
$('#btn-add-to-bag').show();
$('#btn-show-bag').hide();
$('#btn-check-out').parent().show();
@ -170,7 +169,6 @@
$('#btn-add-to-bag').hide();
$('#btn-show-bag').show();
$('#btn-check-out').parent().hide();
$('#count-items-in-bag').html(objProductInfo.quantity+`<svg style="fill: white; width: 12px; margin-left: 3px; margin-bottom: 2px;" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path d="M352 128C352 57.42 294.579 0 224 0 153.42 0 96 57.42 96 128H0v304c0 44.183 35.817 80 80 80h288c44.183 0 80-35.817 80-80V128h-96zM224 48c44.112 0 80 35.888 80 80H144c0-44.112 35.888-80 80-80zm176 384c0 17.645-14.355 32-32 32H80c-17.645 0-32-14.355-32-32V176h48v40c0 13.255 10.745 24 24 24s24-10.745 24-24v-40h160v40c0 13.255 10.745 24 24 24s24-10.745 24-24v-40h48v256z"/></svg>`);
}
}
}
@ -179,6 +177,7 @@
let index = objProducts.indexOf(objProductInfo);
if(index == -1) objProducts.push({id: productId, quantity: 1});
updateProductsInLocalStorage();
//<svg style="fill: white; width: 12px; margin-left: 3px; margin-bottom: 2px;" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path d="M352 128C352 57.42 294.579 0 224 0 153.42 0 96 57.42 96 128H0v304c0 44.183 35.817 80 80 80h288c44.183 0 80-35.817 80-80V128h-96zM224 48c44.112 0 80 35.888 80 80H144c0-44.112 35.888-80 80-80zm176 384c0 17.645-14.355 32-32 32H80c-17.645 0-32-14.355-32-32V176h48v40c0 13.255 10.745 24 24 24s24-10.745 24-24v-40h160v40c0 13.255 10.745 24 24 24s24-10.745 24-24v-40h48v256z"/></svg>
}
$(window).on('load', function(){
if(localStorage.getItem("dismiss-message") == 1) $('.alert-dismissible').remove();