added group_name
This commit is contained in:
@@ -61,25 +61,7 @@ class ProductLinkCheckerProductDataGenerateModuleFrontController extends ModuleF
|
||||
continue;
|
||||
}
|
||||
|
||||
// 1. Add the main product data (as a product without a specific combination)
|
||||
$all_product_data[] = [
|
||||
'id_product' => (int)$product->id,
|
||||
'id_product_attribute' => 0, // 0 for the main product
|
||||
'meta_title' => $product->meta_title,
|
||||
// Grouping meta fields for clarity
|
||||
'meta_description' => $product->meta_description,
|
||||
'title' => $product->name,
|
||||
'description' => Tools::getValue('plc_no_description') ? null : $product->description,
|
||||
'description_short' => Tools::getValue('plc_no_description_short') ? null : $product->description_short,
|
||||
'mpn' => $product->mpn ?? null,
|
||||
'reference' => $product->reference ?? null,
|
||||
'ean13' => $product->ean13 ?? null,
|
||||
'upc' => $product->upc ?? null,
|
||||
'id_language' => (int)$id_lang,
|
||||
'id_shop' => (int)$id_shop,
|
||||
'link' => $this->context->link->getProductLink($product),
|
||||
'link_rewrite' => $product->link_rewrite,
|
||||
];
|
||||
|
||||
|
||||
// 2. Add data for all attribute combinations
|
||||
if ($product->hasAttributes()) {
|
||||
@@ -89,6 +71,8 @@ class ProductLinkCheckerProductDataGenerateModuleFrontController extends ModuleF
|
||||
foreach ($combinations as $combination) {
|
||||
$all_product_data[] = [
|
||||
'id_product' => (int)$product->id,
|
||||
'group_name' => $combination['group_name'] ?? null,
|
||||
'attribute_name' => $combination['attribute_name'] ?? null,
|
||||
'id_product_attribute' => (int)$combination['id_product_attribute'],
|
||||
'meta_title' => $product->meta_title, // Meta is usually product-level
|
||||
'meta_description' => $product->meta_description,
|
||||
@@ -108,6 +92,25 @@ class ProductLinkCheckerProductDataGenerateModuleFrontController extends ModuleF
|
||||
];
|
||||
}
|
||||
}
|
||||
} else { // 1. Add the main product data (as a product without a specific combination)
|
||||
$all_product_data[] = [
|
||||
'id_product' => (int)$product->id,
|
||||
'id_product_attribute' => 0, // 0 for the main product
|
||||
'meta_title' => $product->meta_title,
|
||||
// Grouping meta fields for clarity
|
||||
'meta_description' => $product->meta_description,
|
||||
'title' => $product->name,
|
||||
'description' => Tools::getValue('plc_no_description') ? null : $product->description,
|
||||
'description_short' => Tools::getValue('plc_no_description_short') ? null : $product->description_short,
|
||||
'mpn' => $product->mpn ?? null,
|
||||
'reference' => $product->reference ?? null,
|
||||
'ean13' => $product->ean13 ?? null,
|
||||
'upc' => $product->upc ?? null,
|
||||
'id_language' => (int)$id_lang,
|
||||
'id_shop' => (int)$id_shop,
|
||||
'link' => $this->context->link->getProductLink($product),
|
||||
'link_rewrite' => $product->link_rewrite,
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user