fix basket

This commit is contained in:
ludo
2023-10-31 17:05:41 +01:00
parent 12903b6029
commit cc9672ddca
14 changed files with 144 additions and 88 deletions

View File

@@ -25,43 +25,11 @@
])
@endif
@include('load.basket')
@push('js')
<script>
$('.basket').click(function() {
var type = $(this).data('type');
var offer_id = $('#' + type + '-offer_id').find('option:selected').val();
var quantity = $('#' + type + '-quantity').val();
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()",
);
});
initBasket();
function setPrice(model) {
var offer_id = $('#' + model + '-offer_id').find('option:selected').val();