Filters collapsed, customer auth and register, fix on basket recalculation

This commit is contained in:
Ludovic CANDELLIER
2022-04-20 00:16:16 +02:00
parent a12dd0c653
commit 94234218d6
31 changed files with 218 additions and 251 deletions

View File

@@ -17,7 +17,7 @@
</div>
</div>
@foreach ($basket as $nature => $items)
<div class="row mb-3 p-2 bg-green-light border">
<div class="row ml-1 mb-3 p-2 bg-green-light border">
<div class="col-12">
<h2 style="font-size: 1.6em;">{{ ucfirst($nature) }}</h2>
@foreach ($items as $item)
@@ -75,10 +75,11 @@
$('.basket-quantity').change(function() {
var offer_id = $(this).data('id');
var quantity = $(this).val();
var $row = $(this).parents('.row');
console.log("add basket");
console.log(quantity);
updateBasket(offer_id, quantity, function() {
calculatePrice($(this).parents('.basket-row'));
calculatePrice($row);
calculateTotal();
});
});
@@ -98,6 +99,8 @@
}
function calculatePrice($that) {
console.log('calculatePrice');
console.log($that);
var quantity = $that.find('.basket-quantity').val();
var price = $that.find('.basket-price').text();
var total_price = fixNumber(quantity * price);