Add variations, slider, fix cart ...

This commit is contained in:
Ludovic CANDELLIER
2022-03-21 21:52:12 +01:00
parent 0eaa11b2a9
commit ddc5f2664c
27 changed files with 438 additions and 81 deletions

View File

@@ -0,0 +1,51 @@
@component('components.card', [
'id_card' => $model . '-basket',
'title' => $title,
'class' => 'mb-3',
])
@include('components.form.select', [
'name' => 'offer_id',
'id_name' => $model . '-offer_id',
'list' => collect($data)->pluck('name', 'id')->toArray(),
'class' => 'select2 mb-2',
])
<div class="row">
<div class="col-4">
@include('components.form.inputs.number', [
'name' => 'quantity',
'id_name' => $model . '-quantity',
'value' => 1,
])
</div>
<div class="col-8 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>
@endpush