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,38 +62,7 @@
<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>
@ -114,22 +70,18 @@
<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,15 +108,9 @@
} }
$(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",
cache : false,
processData: false,
contentType: false,
success: function (response) {
response.contents.forEach(function(item){
$('#list-products-in-bag').append(` $('#list-products-in-bag').append(`
<tr> <tr>
<td class="text-start"> <td class="text-start">
@ -184,10 +130,7 @@
<td class="align-middle text-end">18,00€</td> <td class="align-middle text-end">18,00€</td>
</tr>`); </tr>`);
}); });
}, else $('#count-products-in-bag').hide();
error: function(error) {
console.log(error);
}
}); });
}); });
</script> </script>