diff --git a/content/master.blade.php b/content/master.blade.php
index b8a19a6..8371e5f 100644
--- a/content/master.blade.php
+++ b/content/master.blade.php
@@ -1,6 +1,7 @@
+
@insert("content.includes.meta")
@insert("content.includes.css")
@yield('head')
@@ -103,9 +104,10 @@
let objProducts = [];
function updateProductsInLocalStorage(){
localStorage.setItem("products", JSON.stringify(objProducts));
+ $('#count-products-in-bag').text(objProducts.length);
if(objProducts.length > 0) {
- $.get("{{url('/contents/all')}}/"+objProducts.join(","), function(response, status){
- $('#count-products-in-bag').text(response.contents.length);
+ $('#count-products-in-bag').show();
+ $.get($('meta[name="get-contents"]').attr('content')+"/"+objProducts.join(","), function(response, status){
$('#list-products-in-bag').html('');
response.contents.forEach(function(item){
$('#list-products-in-bag').append(`
@@ -123,7 +125,6 @@
- Löschen
18,00€ |
`);
@@ -132,43 +133,12 @@
}else $('#count-products-in-bag').hide();
}
function addToBag(productId){
- if(objProducts.indexOf(productId) == -1) objProducts.push(productId);
+ if(objProducts.indexOf(productId) == -1) objProducts.push(productId+':'+1);
updateProductsInLocalStorage();
}
$(window).on('load', function(){
if(localStorage.getItem("products") != null) objProducts = JSON.parse(localStorage.getItem("products"));
-<<<<<<< HEAD
- $.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
-
-
- Löschen
-ds
- |
- 18,00€
-
- |
-
`);
- });
- else $('#count-products-in-bag').hide();
- });
-=======
updateProductsInLocalStorage();
->>>>>>> e4497e2d3c22ce5756190e6ee74fbeb1d9d09fad
});
@yield('scripts')