fix
This commit is contained in:
@@ -18,5 +18,4 @@ class ArticleController extends Controller
|
||||
// exit;
|
||||
return view('Shop.Articles.show', $data);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ use App\Http\Controllers\Controller;
|
||||
use App\Repositories\Shop\Categories;
|
||||
use App\Repositories\Shop\Offers;
|
||||
use App\Repositories\Shop\Tags;
|
||||
use App\Repositories\Shop\TagGroups;
|
||||
|
||||
class CategoryController extends Controller
|
||||
{
|
||||
@@ -22,6 +23,7 @@ class CategoryController extends Controller
|
||||
$data['category'] = Categories::getFull($id);
|
||||
$data['offers'] = Offers::getByCategoryWithTags($id);
|
||||
$data['tags'] = Tags::getWithCountOffers();
|
||||
$data['tags2'] = TagGroups::getWithTagsAndCountOffers();
|
||||
dump($data);
|
||||
exit;
|
||||
return view('Shop.shelve', $data);
|
||||
|
||||
@@ -8,6 +8,7 @@ use App\Http\Controllers\Controller;
|
||||
use App\Repositories\Shop\Articles;
|
||||
use App\Repositories\Shop\Categories;
|
||||
use App\Repositories\Shop\Offers;
|
||||
use App\Repositories\Shop\Tags;
|
||||
|
||||
class HomeController extends Controller
|
||||
{
|
||||
@@ -23,6 +24,8 @@ class HomeController extends Controller
|
||||
$data['display_by_rows'] = $input['by_rows'] ?? false;
|
||||
// $data['offers'] = Offers::getLast()->toArray();
|
||||
$data['articles'] = Articles::getArticlesToSell();
|
||||
$data['tags'] = Tags::getWithCountOffers();
|
||||
|
||||
// $data['prices'] = $data['articles']['offers'][0]['tariff']['price_lists'][0]['price_list_values'][0];
|
||||
// dump($data);
|
||||
// exit;
|
||||
|
||||
@@ -19,6 +19,11 @@ class TagGroups
|
||||
return TagGroup::get()->SortBy('name')->pluck('name', 'id')->toArray();
|
||||
}
|
||||
|
||||
public static function getWithTagsAndCountOffers()
|
||||
{
|
||||
return TagGroup::with('tags')->withCount(['tags.articles'])->get()->toArray();
|
||||
}
|
||||
|
||||
public static function getTreeTags()
|
||||
{
|
||||
$items = TagGroup::with('tags')->get();
|
||||
|
||||
@@ -18,16 +18,32 @@
|
||||
'title' => 'Semence',
|
||||
'class' => 'mb-3',
|
||||
])
|
||||
@include('components.form.button', [
|
||||
'class' => 'btn-success basket semences',
|
||||
'txt' => 'Ajouter au panier',
|
||||
])
|
||||
@include('components.form.button', [
|
||||
'class' => 'btn-success basket semences',
|
||||
'txt' => 'Ajouter au panier',
|
||||
])
|
||||
@endcomponent
|
||||
|
||||
@component('components.card', [
|
||||
'title' => 'Plant',
|
||||
'class' => 'mb-3',
|
||||
])
|
||||
@include('components.form.button', [
|
||||
'class' => 'btn-success basket plants',
|
||||
'txt' => 'Ajouter au panier',
|
||||
])
|
||||
@endcomponent
|
||||
|
||||
@component('components.card', [
|
||||
'title' => 'Légume',
|
||||
'class' => 'mb-3',
|
||||
])
|
||||
@include('components.form.button', [
|
||||
'class' => 'btn-success basket legumes',
|
||||
'txt' => 'Ajouter au panier',
|
||||
])
|
||||
@endcomponent
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
2
resources/views/Shop/Tags/partials/filter.blade.php
Normal file
2
resources/views/Shop/Tags/partials/filter.blade.php
Normal file
@@ -0,0 +1,2 @@
|
||||
@foreach ($tags as $tag)
|
||||
@endforeach
|
||||
@@ -3,9 +3,15 @@
|
||||
])
|
||||
|
||||
@section('content')
|
||||
@if ($display_by_rows ?? false)
|
||||
@include('Shop.layout.partials.category_articles_rows')
|
||||
@else
|
||||
@include('Shop.layout.partials.category_articles')
|
||||
@endif
|
||||
<div class="row">
|
||||
<div class="col-2">
|
||||
</div>
|
||||
<div class="col-10">
|
||||
@if ($display_by_rows ?? false)
|
||||
@include('Shop.layout.partials.category_articles_rows')
|
||||
@else
|
||||
@include('Shop.layout.partials.category_articles')
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
Reference in New Issue
Block a user