fix on product null

This commit is contained in:
ludo
2023-11-08 17:07:53 +01:00
parent 81974d38ab
commit 37f1ebbb59
2 changed files with 10 additions and 1 deletions

View File

@@ -346,6 +346,9 @@ class Articles
switch ($product_type) {
case 'App\Models\Botanic\Variety':
$product = Varieties::get($product_id);
if (!$product) {
break;
}
$data[] = [
'name' => 'Espèces',
'description' => Species::getDescription($product->specie_id),
@@ -359,6 +362,9 @@ class Articles
break;
case 'App\Models\Botanic\Specie':
$product = Species::get($product_id);
if (!$product) {
break;
}
$data[] = [
'name' => 'Espèces',
'description' => $product->description,
@@ -367,6 +373,9 @@ class Articles
break;
case 'App\Models\Shop\Merchandise':
$product = Merchandises::get($product_id);
if (!$product) {
break;
}
$data[] = [
'name' => 'Marchandise',
'description' => $product->description,