quick add to basket on shelves

This commit is contained in:
Ludovic CANDELLIER
2023-02-27 23:16:15 +01:00
parent b3d16a06b0
commit 0828ac3377
7 changed files with 53 additions and 14 deletions

View File

@@ -6,4 +6,43 @@
</div>
@endforeach
@endif
</div>
</div>
@push('js')
<script>
$('.basket').click(function() {
var offer_id = $(this).data('id');
var quantity = 1;
var data = {
'offer_id': offer_id,
'quantity': quantity,
};
var buttons = {
cancel: {
label: '{{ __('Continuer mes achats') }}',
className: 'btn-secondary'
},
confirm: {
label: '{{ __('Commander') }}',
className: 'btn-success',
callback: function() {
window.location = "{{ route('Shop.Basket.basket') }}";
}
},
};
openModal(
'Ajout dans le panier',
'basket-form',
"{{ route('Shop.Basket.modalBasket') }}/" + offer_id + '/' + quantity,
"{{ route('Shop.Orders.order') }}",
false,
false,
true,
buttons,
"refreshBasketTop()",
);
});
</script>
@endpush