Skip to content
This repository was archived by the owner on Apr 29, 2019. It is now read-only.

Commit b5d4130

Browse files
Freek VandeursenFreek Vandeursen
Freek Vandeursen
authored and
Freek Vandeursen
committed
Handle forced attribute codes
1 parent c0d696e commit b5d4130

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

app/code/Magento/CatalogImportExport/Model/Import/Product/Type/AbstractType.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ protected function _initAttributes()
290290
array_keys(self::$commonAttributesCache),
291291
self::$invAttributesCache
292292
);
293-
if ($unknownAttributeIds) {
293+
if ($unknownAttributeIds || $this->_forcedAttributesCodes) {
294294
$this->attachAttributesById($attributeSetName, $attributeIds);
295295
}
296296
}
@@ -317,8 +317,11 @@ protected function _initAttributes()
317317
protected function attachAttributesById($attributeSetName, $attributeIds)
318318
{
319319
foreach ($this->_prodAttrColFac->create()->addFieldToFilter(
320-
'main_table.attribute_id',
321-
['in' => $attributeIds]
320+
['main_table.attribute_id', 'main_table.attribute_code'],
321+
[
322+
['in' => $attributeIds],
323+
['in' => $this->_forcedAttributesCodes]
324+
]
322325
) as $attribute) {
323326
$attributeCode = $attribute->getAttributeCode();
324327
$attributeId = $attribute->getId();

0 commit comments

Comments
 (0)