fix on empty articles
This commit is contained in:
@@ -25,8 +25,6 @@ class CategoryController extends Controller
|
|||||||
$data['category'] = Categories::getFull($category_id);
|
$data['category'] = Categories::getFull($category_id);
|
||||||
$data['articles'] = Articles::getArticlesToSell($category_id);
|
$data['articles'] = Articles::getArticlesToSell($category_id);
|
||||||
$data['tags'] = TagGroups::getWithTagsAndCountOffers();
|
$data['tags'] = TagGroups::getWithTagsAndCountOffers();
|
||||||
// dump($data);
|
|
||||||
// exit;
|
|
||||||
return view('Shop.shelve', $data);
|
return view('Shop.shelve', $data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ class Articles
|
|||||||
}
|
}
|
||||||
// dump($data);
|
// dump($data);
|
||||||
// exit;
|
// exit;
|
||||||
return $data;
|
return $data ?? false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getArticlesWithOffers($category_id = false, $tags = false)
|
public static function getArticlesWithOffers($category_id = false, $tags = false)
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
Il y a {{ count($articles) ?? 0 }} article(s) dans la liste
|
Il y a {{ $articles ? count($articles) : 0 }} article(s) dans la liste
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
|
@if ($articles)
|
||||||
@foreach ($articles as $product_name => $article)
|
@foreach ($articles as $product_name => $article)
|
||||||
<div class="col-sm-3 col-lg-2">
|
<div class="col-sm-3 col-lg-2">
|
||||||
@include('Shop.Articles.partials.article')
|
@include('Shop.Articles.partials.article')
|
||||||
</div>
|
</div>
|
||||||
@endforeach
|
@endforeach
|
||||||
|
@endif
|
||||||
</div>
|
</div>
|
||||||
@@ -1,3 +1,5 @@
|
|||||||
@foreach ($articles as $product_name => $article)
|
@if ($articles)
|
||||||
|
@foreach ($articles as $product_name => $article)
|
||||||
@include('Shop.Articles.partials.article_rows')
|
@include('Shop.Articles.partials.article_rows')
|
||||||
@endforeach
|
@endforeach
|
||||||
|
@endif
|
||||||
Reference in New Issue
Block a user