56 lines
1.6 KiB
PHP
56 lines
1.6 KiB
PHP
@if ($article['offers']['semences'] ?? false)
|
|
@include('Shop.Articles.partials.addBasket', [
|
|
'data' => $article['offers']['semences'],
|
|
'title' => 'Semences',
|
|
'model' => 'semences',
|
|
'bgClass' => 'bg-green-light',
|
|
])
|
|
@endif
|
|
|
|
@if ($article['offers']['plants'] ?? false)
|
|
@include('Shop.Articles.partials.addBasket', [
|
|
'data' => $article['offers']['plants'],
|
|
'title' => 'Plants',
|
|
'model' => 'plants',
|
|
'bgClass' => 'bg-green-light',
|
|
])
|
|
@endif
|
|
|
|
@if ($article['offers']['legumes'] ?? false)
|
|
@include('Shop.Articles.partials.addBasket', [
|
|
'data' => $article['offers']['legumes'],
|
|
'title' => 'Légumes',
|
|
'model' => 'legumes',
|
|
'bgClass' => 'bg-green-light',
|
|
])
|
|
@endif
|
|
|
|
@if ($article['offers']['marchandise'] ?? false)
|
|
@include('Shop.Articles.partials.addBasket', [
|
|
'data' => $article['offers']['marchandise'],
|
|
'title' => 'Marchandises',
|
|
'model' => 'marchandise',
|
|
'bgClass' => 'bg-green-light',
|
|
])
|
|
@endif
|
|
|
|
@include('load.basket')
|
|
|
|
@push('js')
|
|
<script>
|
|
initBasket();
|
|
|
|
function setPrice(model) {
|
|
var offer_id = $('#' + model + '-offer_id').find('option:selected').val();
|
|
var quantity = $('#' + model + '-quantity').val();
|
|
var data = {
|
|
'offer_id': offer_id,
|
|
'quantity': quantity,
|
|
};
|
|
$.post('{{ route('Shop.Basket.getPrice') }}', data, function(data) {
|
|
$('#' + model + '-price').html(data);
|
|
});
|
|
}
|
|
</script>
|
|
@endpush
|