add shipping to order, methods to calculate, little refactoring

This commit is contained in:
ludo
2023-11-15 23:20:42 +01:00
parent 216c408596
commit 174c4ca0e2
10 changed files with 117 additions and 45 deletions

View File

@@ -13,27 +13,32 @@
<span id="basket-count">{{ $basket['quantity'] ?? 0 }}</span> ARTICLES
</div>
<div class="col-6 text-right font-weight-bold">
<span id="basket-total">{{ $basket['total'] ?? 0 }}</span>
<span id="basket-total">
{{ $basket['total_taxed'] ?? 0 }}
</span>
</div>
</div>
<!--
<div class="row mb-3">
<div class="col-6">
LIVRAISON
@if ($basket['shipping'])
<div class="row mb-3">
<div class="col-6">
LIVRAISON
</div>
<div class="col-6 text-right font-weight-bold">
<span id="shipping">
{{ $basket['shipping'] }}
</span>
</div>
</div>
<div class="col-6 text-right font-weight-bold">
<span id="shipping">5</span>
</div>
</div>
<hr>
-->
<hr>
@endif
<div class="row mb-3 font-weight-bold" style="font-size: 1.6em;">
<div class="col-6">
TOTAL TTC
</div>
<div class="col-6 text-right">
<span
id="basket-total-shipped">{{ App\Repositories\Core\User\ShopCart::fixDecimal($basket['total'] ?? 0) }}</span>
<span id="basket-total-shipped">
{{ $basket['total_shipped'] ?? 0 }}
</span>
</div>
</div>

View File

@@ -29,7 +29,7 @@
@if ($basket['count'])
<div class="col-4">
<x-card class='shadow'>
@include('Shop.Baskets.partials.basketTotal')
@include('Shop.Baskets.partials.basketTotal', ['basket' => $basket])
</x-card>
</div>
@endif

View File

@@ -1,3 +1,28 @@
@foreach ($delivery_types as $delivery_type)
@endforeach
@if ($delivery_types ?? false)
<table class="">
<thead>
<tr>
<th colspan="3">
Choix du transporteur
</th>
</tr>
</thead>
@foreach ($delivery_types as $delivery_type_id => $delivery_type)
<tr>
<td>
@include('components.form.radios.icheck', [
'name' => 'delivery_type_id',
'val' => $delivery_type_id,
'check' => false,
])
</td>
<td>
{{ $delivery_type['name'] }}
</td>
<td class="text-right">
{{ $delivery_type['price'] }}
</td>
</tr>
@endforeach
</table>
@endif