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); $('#list-products').append(elementProduct);
}); });
$('#total-checkout-price').text(numberToEuroFormat(totalPrice)); $('#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(); $('#form-section').show();
$('#list-products').parent().parent().parent().parent().parent().find('.modal-footer').show(); $('#list-products').parent().parent().parent().parent().parent().find('.modal-footer').show();
$('#total-checkout-price').parent().parent().parent().show(); $('#total-checkout-price').parent().parent().parent().show();
$('#no-products-in-checkout').hide(); $('#no-products-in-checkout').hide();
$('#cart-error-in-checkout').hide(); }else{
}
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{
$('#form-section').hide(); $('#form-section').hide();
$('#list-products').parent().parent().parent().parent().parent().find('.modal-footer').hide(); $('#list-products').parent().parent().parent().parent().parent().find('.modal-footer').hide();
$('#total-checkout-price').parent().parent().parent().hide(); $('#total-checkout-price').parent().parent().parent().hide();
$('#no-products-in-checkout').show(); $('#no-products-in-checkout').show();
$('#cart-error-in-checkout').hide();
} }
} }


@ -76,14 +60,12 @@ $(window).on('load', function(){
let products = response.contents.map(product => { let products = response.contents.map(product => {
product = getProductInfo(product); product = getProductInfo(product);
product = calculatePrice(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(JSON.stringify({"total-price": totalPrice, "products": products}));
$('#ccart').val(cart); objProducts = [];
console.log($('form').serializeArray()); localStorage.setItem("products", JSON.stringify(objProducts));
//objProducts = []; form.unbind('submit').submit();
//localStorage.setItem("products", JSON.stringify(objProducts));
//form.unbind('submit').submit();
}); });
}); });
$(document).on('click', '.btn-remove-product', function(){ $(document).on('click', '.btn-remove-product', function(){

View File

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

View File

@ -106,9 +106,6 @@
</div> </div>
<div class="modal-body"> <div class="modal-body">
<div class="row"> <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"> <div style="display: none;" class="col-12 text-center" id="no-products">


<br> <br>

View File

@ -58,9 +58,6 @@
<!-- Calendly inline widget end --> <!-- Calendly inline widget end -->
</div> </div>
@else @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"> <div style="display: none;" class="col-12 text-center" id="no-products-in-checkout">
<br> <br>
<br> <br>