Added combination attributes to ICML

This commit is contained in:
gleemand 2021-10-18 17:52:16 +03:00 committed by GitHub
parent 34ce76b4a6
commit 78316bd4c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 2 deletions

View File

@ -221,7 +221,8 @@ class RetailcrmCatalog
foreach ($combinations as $combination) {
$arSet = [
'group_name' => $combination['group_name'],
'attribute' => $combination['attribute_name'],
'id_attribute_group' => $combination['id_attribute_group'],
'attribute_name' => $combination['attribute_name'],
];
$arComb[] = $arSet;
@ -285,10 +286,15 @@ class RetailcrmCatalog
if (!empty($combinations)) {
foreach ($arComb as $itemComb) {
$item[mb_strtolower($itemComb['group_name'])] = htmlspecialchars($itemComb['attribute']);
$item['combination'][$itemComb['id_attribute_group']] = [
'group_name' => mb_strtolower($itemComb['group_name']),
'attribute_name' => htmlspecialchars($itemComb['attribute_name']),
];
}
}
unset($arComb);
yield RetailcrmTools::filter(
'RetailcrmFilterProcessOffer',
$item,

View File

@ -182,6 +182,18 @@ class RetailcrmIcml
$e->appendChild($param);
}
}
if (isset($offer['combination'])) {
foreach ($offer['combination'] as $id => $comb) {
$param = $this->dd->createElement('param');
$param->setAttribute('code', $id);
$param->setAttribute('name', $comb['group_name']);
$param->appendChild(
$this->dd->createTextNode($comb['attribute_name'])
);
$e->appendChild($param);
}
}
}
}
}