Gustavo Luigi 2022-08-30 10:34:07 +02:00
parent f5fb93e893
commit 7db0780544
1 changed files with 32 additions and 89 deletions

View File

@ -44,23 +44,10 @@
<a href="{{url('/kontakt')}}" class="text-decoration-none mt-2 fw-bold">Kontakt</a> <a href="{{url('/kontakt')}}" class="text-decoration-none mt-2 fw-bold">Kontakt</a>
</div> </div>
<div class="col-1 text-end"> <div class="col-1 text-end">


<a href="" data-bs-toggle="modal" data-bs-target="#ShoppingCart" class="position-relative"> <a href="" data-bs-toggle="modal" data-bs-target="#ShoppingCart" class="position-relative">
<svg style="fill: white; width: 30px; margin-top: 6px;" 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> <svg style="fill: white; width: 30px; margin-top: 6px;" 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>

<span class="position-absolute top-0 start-90 translate-middle badge rounded-pill bg-danger" id="count-products-in-bag">0</span>
@if(3==3)
<span class="position-absolute top-0 start-90 translate-middle badge rounded-pill bg-danger">
3<span class="visually-hidden">Produkte im Warenkorb</span>
</span>
@endif



</a> </a>


<!-- Modal -->
<div class="modal fade" id="ShoppingCart" tabindex="-1" aria-labelledby="ShoppingCart" aria-hidden="true"> <div class="modal fade" id="ShoppingCart" tabindex="-1" aria-labelledby="ShoppingCart" aria-hidden="true">
<div class="modal-dialog modal-lg"> <div class="modal-dialog modal-lg">
<div class="modal-content"> <div class="modal-content">
@ -75,61 +62,26 @@
<div class="row"> <div class="row">
<div class="col-12"> <div class="col-12">
<table class="table table-striped"> <table class="table table-striped">

<tbody id="list-products-in-bag"></tbody>
<tbody id="list-products-in-bag">

<!-- <tr>
<td class="text-start">
<img class="rounded img-fluid" src="https://picsum.photos/100/100">


</td>

<td class="text-start">
<span class="fs-5">Longi 375 Modul</span>
<br>
<small class="text-success">sofort verfügbar</small>
<br>

<select class="form-select form-select-sm mt-2" style="width: 125px;" aria-label="Default select example">
<option selected value="1">Anzahl: 1</option>
<option value="2">Anzahl: 2</option>
<option value="3">Anzahl: 3</option>
</select>
</td>

<td class="align-middle text-end">18,00€
<br>
<a href="" class="small text-muted text-decoration-none">Löschen</a>
</td>

</tr> -->


</tbody>
<tfoot> <tfoot>
<tr> <tr>
<th class="text-start" scope="col">Gesammt:</th> <th class="text-start" scope="col">Gesammt:</th>
<th colspan="3" class="text-end">2838,00 € <th colspan="3" class="text-end">2838,00 €
<br> <br>
<small class="text-end fw-light">Preise inkl. 19% Umsatzsteuer</small> <small class="text-end fw-light">Preise inkl. 19% Umsatzsteuer</small>
</th> </th>

</tr>
</tr>
</tfoot> </tfoot>

</table> </table>
</div> </div>
</div> </div>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">

<a href="{{url('/checkout')}}" type="button" class="btn btn-primary">Angebot unverbindlich anfragen</a> <a href="{{url('/checkout')}}" type="button" class="btn btn-primary">Angebot unverbindlich anfragen</a>
</div> </div>
</div> </div>
</div> </div>
</div> </div>

</div> </div>
</div> </div>
</div> </div>
@ -156,38 +108,29 @@
} }
$(window).on('load', function(){ $(window).on('load', function(){
if(localStorage.getItem("products") != null) objProducts = JSON.parse(localStorage.getItem("products")); if(localStorage.getItem("products") != null) objProducts = JSON.parse(localStorage.getItem("products"));
$.ajax({ $.get("{{url('/contents/all')}}/"+objProducts.join(","), function(response, status){
headers: { 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') }, $('#count-products-in-bag').text(response.contents.length);
url: "{{url('/contents/all')}}/"+objProducts.join(","), if(response.contents.length > 0) response.contents.forEach(function(item){
type: "get", $('#list-products-in-bag').append(`
cache : false, <tr>
processData: false, <td class="text-start">
contentType: false, <img class="rounded img-fluid" src="https://picsum.photos/120/120">
success: function (response) { </td>
response.contents.forEach(function(item){ <td class="text-start">
$('#list-products-in-bag').append(` <span class="fs-5">${item.title}</span>
<tr> <br>
<td class="text-start"> <small class="text-success">sofort verfügbar</small>
<img class="rounded img-fluid" src="https://picsum.photos/120/120"> <br>
</td> <select class="form-select form-select-sm" aria-label="Default select example">
<td class="text-start"> <option selected value="1">Anzahl: 1</option>
<span class="fs-5">${item.title}</span> <option value="2">Anzahl: 2</option>
<br> <option value="3">Anzahl: 3</option>
<small class="text-success">sofort verfügbar</small> </select>
<br> </td>
<select class="form-select form-select-sm" aria-label="Default select example"> <td class="align-middle text-end">18,00€</td>
<option selected value="1">Anzahl: 1</option> </tr>`);
<option value="2">Anzahl: 2</option> });
<option value="3">Anzahl: 3</option> else $('#count-products-in-bag').hide();
</select>
</td>
<td class="align-middle text-end">18,00€</td>
</tr>`);
});
},
error: function(error) {
console.log(error);
}
}); });
}); });
</script> </script>