Files
opensem/resources/views/Shop/Articles/partials/addBasket.blade.php
Ludovic CANDELLIER f3e9ccaa46 'fixes'
2022-04-24 22:07:31 +02:00

52 lines
1.1 KiB
PHP

@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-5">
@include('components.form.inputs.number', [
'name' => '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>
@endcomponent
@push('js')
<script>
$('#{{ $model }}-quantity').change(function() {
setPrice('{{ $model }}');
});
$('#{{ $model }}-offer_id').change(function() {
setPrice('{{ $model }}');
});
</script>
@endpush