try to refresh total with recalculation by delivery and delivery_type
This commit is contained in:
@@ -29,7 +29,9 @@
|
|||||||
@if ($basket['count'])
|
@if ($basket['count'])
|
||||||
<div class="col-4">
|
<div class="col-4">
|
||||||
<x-card class='shadow'>
|
<x-card class='shadow'>
|
||||||
@include('Shop.Baskets.partials.basketTotal', ['basket' => $basket])
|
<div id="basketTotal">
|
||||||
|
@include('Shop.Baskets.partials.basketTotal', ['basket' => $basket])
|
||||||
|
</div>
|
||||||
</x-card>
|
</x-card>
|
||||||
</div>
|
</div>
|
||||||
@endif
|
@endif
|
||||||
@@ -61,6 +63,13 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function refreshBasketTotal(deliveryId, deliveryTypeId) {
|
||||||
|
options = deliveryId + '/' + deliveryTypeId;
|
||||||
|
$.get("{{ Route('Shop.Basket.getBasketTotal') }}/" + options, function(data) {
|
||||||
|
$('#basketTotal').html(data);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
initChevron();
|
initChevron();
|
||||||
</script>
|
</script>
|
||||||
@endpush
|
@endpush
|
||||||
|
|||||||
@@ -21,3 +21,15 @@ ci-contre
|
|||||||
@include('components.form.textarea', [
|
@include('components.form.textarea', [
|
||||||
'name' => 'content',
|
'name' => 'content',
|
||||||
])
|
])
|
||||||
|
|
||||||
|
@push('js')
|
||||||
|
<script>
|
||||||
|
$('.delivery_mode').click(function() {
|
||||||
|
var deliveryTypeId = $(this).val();
|
||||||
|
var deliveryId = $('input[name=delivery_id]').val()
|
||||||
|
console.log(deliveryId);
|
||||||
|
console.log(deliveryTypeId);
|
||||||
|
refreshBasketTotal(deliveryId, deliveryTypeId)
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
@endpush
|
||||||
|
|||||||
@@ -13,7 +13,8 @@
|
|||||||
@include('components.form.radios.icheck', [
|
@include('components.form.radios.icheck', [
|
||||||
'name' => 'delivery_type_id',
|
'name' => 'delivery_type_id',
|
||||||
'val' => $delivery_type_id,
|
'val' => $delivery_type_id,
|
||||||
'check' => false,
|
'id' => 'delivery_type_' . $delivery_type_id,
|
||||||
|
'class' => 'delivery_type',
|
||||||
])
|
])
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
@@ -26,3 +27,15 @@
|
|||||||
@endforeach
|
@endforeach
|
||||||
</table>
|
</table>
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
|
@push('js')
|
||||||
|
<script>
|
||||||
|
$('.delivery_type').click(function() {
|
||||||
|
var deliveryId = $(this).val();
|
||||||
|
var deliveryTypeId = $('input[name=delivery_type_id]').val()
|
||||||
|
console.log(deliveryId);
|
||||||
|
console.log(deliveryTypeId);
|
||||||
|
refreshBasketTotal(deliveryId, deliveryTypeId);
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
@endpush
|
||||||
|
|||||||
Reference in New Issue
Block a user