fix on article based on old merchandise

This commit is contained in:
Ludovic CANDELLIER
2023-03-27 21:05:37 +02:00
parent ba8f87cff4
commit 6e4f93dd65
3 changed files with 8 additions and 3 deletions

View File

@@ -29,6 +29,8 @@ class CategoryController extends Controller
// $product_type = Articles::getProductTypeByCategory($category_id); // $product_type = Articles::getProductTypeByCategory($category_id);
// dump($product_type); // dump($product_type);
$article_nature = $request->input('article_nature'); $article_nature = $request->input('article_nature');
// dump($article_nature);
// exit;
switch ($article_nature) { switch ($article_nature) {
case 'semences': case 'semences':
@@ -46,11 +48,14 @@ class CategoryController extends Controller
default: default:
$product_type = 'botanic'; $product_type = 'botanic';
$article_nature_id = 1; $article_nature_id = 1;
$article_nature = 'semences';
break; break;
} }
// $product_type = ArticleNatures::getProductType($article_nature_id); // $product_type = ArticleNatures::getProductType($article_nature_id);
// dump($product_type); // dump($product_type);
// dump($article_nature_id);
} }
// exit;
$data = [ $data = [
'category' => Categories::getFull($category_id), 'category' => Categories::getFull($category_id),
'breadcrumb' => Categories::getAncestorsByCategory($category_id), 'breadcrumb' => Categories::getAncestorsByCategory($category_id),

View File

@@ -321,7 +321,7 @@ class Articles
]; ];
break; break;
} }
return $data; return $data ?? false;
} }
public static function getInheritedImagesByProduct($product_id, $product_type) public static function getInheritedImagesByProduct($product_id, $product_type)
@@ -337,7 +337,7 @@ class Articles
$data['images'] = Merchandises::getImages($product_id); $data['images'] = Merchandises::getImages($product_id);
break; break;
} }
return $data; return $data ?? false;
} }
public static function getMeta(&$data = []) public static function getMeta(&$data = [])

View File

@@ -1,4 +1,4 @@
@if (count($article['inherited'] ?? [])) @if (($article['inherited'] ?? false) && count($article['inherited'] ?? []))
@component('components.layout.box-collapse', [ @component('components.layout.box-collapse', [
'id' => 'product_description_box', 'id' => 'product_description_box',
'title' => 'Informations héritées', 'title' => 'Informations héritées',