<div class="row mx-n1">
	@if ($articles ?? false)
		@foreach ($articles as $product_name => $article)
			<div class="category-card col-6 col-md-4 col-lg-3 mb-2 px-1">
				@include('Shop.Articles.partials.article')
			</div>
		@endforeach
	@endif
</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
