add basket on rows, uniformize baskets
This commit is contained in:
@@ -28,7 +28,9 @@ class CategoryController extends Controller
|
||||
} else {
|
||||
// $product_type = Articles::getProductTypeByCategory($category_id);
|
||||
// dump($product_type);
|
||||
switch ($request->input('article_nature')) {
|
||||
$article_nature = $request->input('article_nature');
|
||||
|
||||
switch ($article_nature) {
|
||||
case 'semences':
|
||||
$product_type = 'botanic';
|
||||
$article_nature_id = 1;
|
||||
@@ -54,7 +56,7 @@ class CategoryController extends Controller
|
||||
'breadcrumb' => Categories::getAncestorsByCategory($category_id),
|
||||
'display_by_rows' => $request->input('display_by_rows') ?? false,
|
||||
'product_type' => $product_type,
|
||||
'article_nature' => $article_nature_id,
|
||||
'article_nature' => $article_nature,
|
||||
'tags_selected' => $request->input('tags') ?? [],
|
||||
'articles' => Articles::getArticlesToSell([
|
||||
'category_id' => $category_id,
|
||||
|
||||
@@ -19,8 +19,17 @@
|
||||
</div>
|
||||
@include('Shop.Articles.partials.article_' . $product_type)
|
||||
</a>
|
||||
<button type="button" class="btn btn-link bg-green text-white w-100 basket" data-id="{{ $article['offers'][0]['id'] ?? false }}">
|
||||
@switch ($article_nature)
|
||||
@case(1)
|
||||
<button type="button" class="btn btn-link bg-green text-white w-100 basket" data-id="{{ $article['semences']['id'] ?? false }}">
|
||||
Ajout rapide
|
||||
</button>
|
||||
@break
|
||||
@case(2)
|
||||
<button type="button" class="btn btn-link bg-green text-white w-100 basket" data-id="{{ $article['plants']['id'] ?? false }}">
|
||||
Ajout rapide
|
||||
</button>
|
||||
@break
|
||||
@endswitch
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
@if ($article_nature == 'semences')
|
||||
<div class="w-100 mt-3 p-1 bg-yellow yellow-dark rounded-lg border text-center">
|
||||
<span style="font-size: 1.4em; font-weight: bold;">{{ $article['semences']['price'] ?? null }}</span> €<br>
|
||||
{{ $article['semences']['variation'] }}
|
||||
<div>
|
||||
Quantité : 1
|
||||
</div>
|
||||
@include('components.form.button', [
|
||||
'class' => 'btn-green-dark basket semences mb-3 mt-2 shadow',
|
||||
'txt' => 'Ajouter au panier',
|
||||
'data_id' => $article['semences']['offer_id'] ?? null,
|
||||
])
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if ($article_nature == 'plants')
|
||||
<div class="w-100 mt-3 p-1 bg-green green-dark rounded-lg border text-center text-white">
|
||||
<span style="font-size: 1.4em; font-weight: bold;">{{ $article['plants']['price'] ?? null }}</span> €<br>
|
||||
{{ $article['plants']['variation'] }}
|
||||
<div>
|
||||
Quantité : 1
|
||||
</div>
|
||||
@include('components.form.button', [
|
||||
'class' => 'btn-success basket plants mb-3 mt-2 shadow',
|
||||
'txt' => 'Ajouter au panier',
|
||||
'data_id' => $article['plants']['offer_id'] ?? null,
|
||||
])
|
||||
</div>
|
||||
@endif
|
||||
@@ -1,5 +1,5 @@
|
||||
@if ($article_nature == 'semences')
|
||||
<div class="w-100 mt-3 p-1 bg-yellow yellow-dark rounded-lg border text-center">
|
||||
<div class="w-100 mt-3 p-1 bg-green-light green-dark rounded-lg border text-center">
|
||||
<span style="font-size: 1.4em; font-weight: bold;">{{ $article['semences']['price'] ?? null }}</span> €<br>
|
||||
{{ $article['semences']['variation'] }}
|
||||
<div>
|
||||
@@ -14,7 +14,7 @@
|
||||
@endif
|
||||
|
||||
@if ($article_nature == 'plants')
|
||||
<div class="w-100 mt-3 p-1 bg-green green-dark rounded-lg border text-center text-white">
|
||||
<div class="w-100 mt-3 p-1 bg-green-light green-dark rounded-lg border text-center">
|
||||
<span style="font-size: 1.4em; font-weight: bold;">{{ $article['plants']['price'] ?? null }}</span> €<br>
|
||||
{{ $article['plants']['variation'] }}
|
||||
<div>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<div class="row mb-3">
|
||||
<div class="col-4">
|
||||
<div class="row btn h-100 products @if($article_nature == 1) shadow2 @endif" data-id="semences">
|
||||
<div class="row btn h-100 products @if($article_nature == 'semences') shadow2 @endif" data-id="semences">
|
||||
<div class="col-lg-6 col-xs-12">
|
||||
<img src="/img/article_natures/semences.png" class="img-fluid">
|
||||
</div>
|
||||
@@ -8,7 +8,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<div class="row btn h-100 products @if($article_nature == 2) shadow2 @endif" data-id="plants">
|
||||
<div class="row btn h-100 products @if($article_nature == 'plants') shadow2 @endif" data-id="plants">
|
||||
<div class="col-lg-6 col-xs-12">
|
||||
<img src="/img/article_natures/plants.png" class="img-fluid" class="img-fluid">
|
||||
</div>
|
||||
@@ -16,7 +16,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<div class="row btn h-100 products @if($article_nature == 3) shadow2 @endif" data-id="legumes">
|
||||
<div class="row btn h-100 products @if($article_nature == 'legumes') shadow2 @endif" data-id="legumes">
|
||||
<div class="col-lg-6 col-xs-12">
|
||||
<img src="/img/article_natures/legumes.png" class="img-fluid" class="img-fluid">
|
||||
</div>
|
||||
|
||||
@@ -46,3 +46,4 @@
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
|
||||
@@ -7,43 +7,3 @@
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@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() {
|
||||
// submitModal(form_id);
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
openModal(
|
||||
'Ajout dans le panier',
|
||||
'basket-form',
|
||||
"{{ route('Shop.Basket.modalBasket') }}/" + offer_id + '/' + quantity,
|
||||
"{{ route('Shop.Orders.order') }}",
|
||||
"",
|
||||
false,
|
||||
true,
|
||||
buttons,
|
||||
"refreshBasketTop()",
|
||||
);
|
||||
});
|
||||
|
||||
</script>
|
||||
@endpush
|
||||
Reference in New Issue
Block a user