fix: add delivery cost on load if delivery is selected

This commit is contained in:
Valentin Lab
2025-10-05 12:38:19 +02:00
parent a5b2196b32
commit d502882052

View File

@@ -50,7 +50,7 @@
@include('load.layout.chevron') @include('load.layout.chevron')
@push('js') @prepend('js')
<script> <script>
$('#customer').click(function() { $('#customer').click(function() {
$(".personal_data").addClass('d-none'); $(".personal_data").addClass('d-none');
@@ -65,7 +65,9 @@
}); });
function refreshBasketTotal(deliveryId, deliveryTypeId) { function refreshBasketTotal(deliveryId, deliveryTypeId) {
options = deliveryId + '/' + deliveryTypeId; var safeDeliveryId = deliveryId !== undefined && deliveryId !== null ? deliveryId : '';
var safeDeliveryTypeId = deliveryTypeId !== undefined && deliveryTypeId !== null ? deliveryTypeId : '';
var options = safeDeliveryId + '/' + safeDeliveryTypeId;
$.get("{{ Route('Shop.Basket.getBasketTotal') }}/" + options, function(data) { $.get("{{ Route('Shop.Basket.getBasketTotal') }}/" + options, function(data) {
$('#basketTotal').html(data); $('#basketTotal').html(data);
}); });
@@ -73,4 +75,4 @@
initChevron(); initChevron();
</script> </script>
@endpush @endprepend