Compare commits

..

No commits in common. "e83c43ab03c08b7ec8a2e483c20425e0d3e57356" and "9bf7acb6484cc68a0199efce1c53968e798b5396" have entirely different histories.

4 changed files with 6 additions and 41 deletions

View File

@ -35,32 +35,16 @@ function updateProducts(){
$('#list-products').append(elementProduct);
});
$('#total-checkout-price').text(numberToEuroFormat(totalPrice));
}).fail(function(response){
$('#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').hide();
$('#cart-error-in-checkout').show();
});
$('#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();
$('#cart-error-in-checkout').hide();
}
else if(totalPrice > 0){
$('#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').hide();
$('#cart-error-in-checkout').show();
}
else{
}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();
$('#cart-error-in-checkout').hide();
}
}

@ -76,14 +60,12 @@ $(window).on('load', function(){
let products = response.contents.map(product => {
product = getProductInfo(product);
product = calculatePrice(product);
return product.quantity+'x '+product.title+' ('+numberToEuroFormat(product.calc_preis)+')';
return product;
});
let cart = products.join('\n')+"\nTotal Price: "+numberToEuroFormat(totalPrice);
$('#ccart').val(cart);
console.log($('form').serializeArray());
//objProducts = [];
//localStorage.setItem("products", JSON.stringify(objProducts));
//form.unbind('submit').submit();
$('#ccart').val(JSON.stringify({"total-price": totalPrice, "products": products}));
objProducts = [];
localStorage.setItem("products", JSON.stringify(objProducts));
form.unbind('submit').submit();
});
});
$(document).on('click', '.btn-remove-product', function(){

View File

@ -113,15 +113,6 @@ function updateProductsInLocalStorage(){
$('#list-products-in-bag').append(elementProduct);
});
$('#total-price').text(numberToEuroFormat(totalPrice));
}).fail(function(response){
$('.cart-link').hide();
$(".btn-share").hide();
$('#count-products-in-bag').hide();
$('#list-products-in-bag').parent().parent().parent().parent().parent().find('.modal-footer').hide();
$('#total-price').parent().parent().parent().hide();
$('#no-products').hide();
$('#cart-error').show();
$('#modal-buttons').hide();
});
$('.cart-link').show();
$(".btn-share").show();
@ -129,7 +120,6 @@ function updateProductsInLocalStorage(){
$('#list-products-in-bag').parent().parent().parent().parent().parent().find('.modal-footer').show();
$('#total-price').parent().parent().parent().show();
$('#no-products').hide();
$('#cart-error').hide();
$('#modal-buttons').show();
cartLink = window.location.origin+'/'+btoa(JSON.stringify(objProducts));
@ -149,7 +139,6 @@ function updateProductsInLocalStorage(){
$('#list-products-in-bag').parent().parent().parent().parent().parent().find('.modal-footer').hide();
$('#total-price').parent().parent().parent().hide();
$('#no-products').show();
$('#cart-error').hide();
$('#modal-buttons').hide();
}
let productId = $('meta[name="product-id"]').attr('content');

View File

@ -106,9 +106,6 @@
</div>
<div class="modal-body">
<div class="row">
<div style="display: none;" class="alert alert-danger" role="alert" id="cart-error">
Fehler beim Laden der Produkte, versuchen Sie, die Seite neu zu laden
</div>
<div style="display: none;" class="col-12 text-center" id="no-products">

<br>

View File

@ -58,9 +58,6 @@
<!-- Calendly inline widget end -->
</div>
@else
<div style="display: none;" class="alert alert-danger" role="alert" id="cart-error-in-checkout">
Fehler beim Laden der Produkte, versuchen Sie die Seite neu zu laden
</div>
<div style="display: none;" class="col-12 text-center" id="no-products-in-checkout">
<br>
<br>