diff --git a/content/master.blade.php b/content/master.blade.php index b5466e7..0f14b3e 100644 --- a/content/master.blade.php +++ b/content/master.blade.php @@ -44,23 +44,10 @@ Kontakt
- - - - @if(3==3) - - 3Produkte im Warenkorb - - @endif - - - + 0 - - -
- @@ -156,38 +108,29 @@ } $(window).on('load', function(){ if(localStorage.getItem("products") != null) objProducts = JSON.parse(localStorage.getItem("products")); - $.ajax({ - headers: { 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') }, - url: "{{url('/contents/all')}}/"+objProducts.join(","), - type: "get", - cache : false, - processData: false, - contentType: false, - success: function (response) { - response.contents.forEach(function(item){ - $('#list-products-in-bag').append(` - - - - - - ${item.title} -
- sofort verfügbar -
- - - 18,00€ - `); - }); - }, - error: function(error) { - console.log(error); - } + $.get("{{url('/contents/all')}}/"+objProducts.join(","), function(response, status){ + $('#count-products-in-bag').text(response.contents.length); + if(response.contents.length > 0) response.contents.forEach(function(item){ + $('#list-products-in-bag').append(` + + + + + + ${item.title} +
+ sofort verfügbar +
+ + + 18,00€ + `); + }); + else $('#count-products-in-bag').hide(); }); });