added attribute grouping
This commit is contained in:
@@ -69,10 +69,8 @@ class ProductLinkCheckerProductDataGenerateModuleFrontController extends ModuleF
|
||||
$combinations = $product->getAttributeCombinations($id_lang);
|
||||
if ($combinations) {
|
||||
foreach ($combinations as $combination) {
|
||||
$all_product_data[] = [
|
||||
$all_product_data[$product->id . '_' . $combination['id_product_attribute']] = [
|
||||
'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,
|
||||
@@ -90,6 +88,10 @@ class ProductLinkCheckerProductDataGenerateModuleFrontController extends ModuleF
|
||||
'link' => $this->context->link->getProductLink($product, null, null, null, (int)$id_lang, (int)$id_shop, (int)$combination['id_product_attribute']),
|
||||
'link_rewrite' => $product->link_rewrite,
|
||||
];
|
||||
$all_product_data[$product->id . '_' . $combination['id_product_attribute']]['attributes'][] = [
|
||||
'group_name' => $combination['group_name'] ?? null,
|
||||
'attribute_name' => $combination['attribute_name'] ?? null,
|
||||
];
|
||||
}
|
||||
}
|
||||
} else { // 1. Add the main product data (as a product without a specific combination)
|
||||
|
||||
Reference in New Issue
Block a user