better management of shipping and basket summary display
This commit is contained in:
@@ -1,54 +1,54 @@
|
||||
@component('components.card', [
|
||||
'id_card' => $model . '-basket',
|
||||
'id_card' => $model . '-basket',
|
||||
'title' => $title,
|
||||
'class' => 'mb-3 addBasket ' . ($bgClass ?? null),
|
||||
'classTitle' => 'mb-0',
|
||||
'outline' => false,
|
||||
'class' => 'mb-3 addBasket ' . ($bgClass ?? null),
|
||||
'classTitle' => 'mb-0',
|
||||
'outline' => false,
|
||||
])
|
||||
@include('components.form.select', [
|
||||
'name' => 'offer_id',
|
||||
'id_name' => $model . '-offer_id',
|
||||
'list' => collect($data)->pluck('name', 'id')->toArray(),
|
||||
'class' => 'select2 mb-2 offer_id',
|
||||
])
|
||||
|
||||
@include('components.form.select', [
|
||||
'name' => 'offer_id',
|
||||
'id_name' => $model . '-offer_id',
|
||||
'list' => collect($data)->pluck('name', 'id')->toArray(),
|
||||
'class' => 'select2 mb-2 offer_id',
|
||||
])
|
||||
|
||||
<div class="row">
|
||||
<div class="col-5">
|
||||
@include('components.form.inputs.number', [
|
||||
'name' => 'quantity',
|
||||
'class' => 'quantity',
|
||||
'id_name' => $model . '-quantity',
|
||||
'value' => 1,
|
||||
])
|
||||
</div>
|
||||
<div class="col-7 text-right">
|
||||
<span id="{{ $model }}-price" style="font-size:2em; font-weight: 600;">
|
||||
{{ $data[0]['prices'][0]['price_taxed'] }}
|
||||
</span>
|
||||
€ TTC
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
@include('components.form.button', [
|
||||
'metadata' => 'data-type=' . $model,
|
||||
'class' => 'btn-success basket w-100 ' . $model,
|
||||
'txt' => 'Ajouter au panier',
|
||||
])
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-5">
|
||||
@include('components.form.inputs.number', [
|
||||
'name' => 'quantity',
|
||||
'class' => 'quantity',
|
||||
'id_name' => $model . '-quantity',
|
||||
'value' => (int) $data[0]['prices'][0]['quantity'],
|
||||
'min' => $data[0]['prices'][0]['quantity'],
|
||||
'step' => 1,
|
||||
])
|
||||
</div>
|
||||
<div class="col-7 text-right">
|
||||
<span id="{{ $model }}-price" style="font-size:2em; font-weight: 600;">
|
||||
{{ $data[0]['prices'][0]['price_taxed'] }}
|
||||
</span>
|
||||
€ TTC
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
@include('components.form.button', [
|
||||
'metadata' => 'data-type=' . $model,
|
||||
'class' => 'btn-success basket w-100 ' . $model,
|
||||
'txt' => 'Ajouter au panier',
|
||||
])
|
||||
</div>
|
||||
</div>
|
||||
@endcomponent
|
||||
|
||||
@push('js')
|
||||
<script>
|
||||
$('#{{ $model }}-quantity').change(function() {
|
||||
setPrice('{{ $model }}');
|
||||
});
|
||||
$('#{{ $model }}-offer_id').change(function() {
|
||||
setPrice('{{ $model }}');
|
||||
});
|
||||
</script>
|
||||
<script>
|
||||
$('#{{ $model }}-quantity').change(function() {
|
||||
setPrice('{{ $model }}');
|
||||
});
|
||||
$('#{{ $model }}-offer_id').change(function() {
|
||||
setPrice('{{ $model }}');
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
Reference in New Issue
Block a user