Fix on data for article, problem with id on polymorphic

This commit is contained in:
Ludovic CANDELLIER
2022-01-18 00:08:04 +01:00
parent 050fd76122
commit 3641bd7d68
5 changed files with 63 additions and 16 deletions

View File

@@ -1,8 +1,8 @@
<a href="{{ route('Shop.Articles.show', ['id' => $article['id']]) }}">
<a href="{{ route('Shop.Articles.show', ['id' => $article['semences']['article_id'] ?? false ]) }}">
<div class="card">
<img src="{{ App\Repositories\Shop\Articles::getPreviewSrc($article['image'] ?? false) }}" class="card-img-top" alt="...">
<div class="card-body">
<span class="card-title">{{ $article['name'] }}</span>
<span class="card-title">{{ $product_name }}</span>
<span class="pull-right">
<i class="fa fa-heart"></i>
</span>
@@ -10,14 +10,15 @@
<p class="card-text">
<div class="row">
<div class="col-6">
3.50 <br>
{{ $article['semences']['price'] ?? null }}<br>
Semence
</div>
<div class="col-6">
1.65 <br>
Plant
</div>
@if ($article['plants'] ?? false)
<div class="col-6">
{{ $article['plants']['price'] }}<br>
Plant
</div>
@endif
</div>
</p>
</div>