Skip to content

Commit 900a707

Browse files
author
Roman Lytvynenko
committed
MC-19661: Export Products bug. I can't exclude attributes from CSV file.
1 parent eb5f201 commit 900a707

File tree

1 file changed

+19
-1
lines changed
  • app/code/Magento/CatalogImportExport/Model/Export

1 file changed

+19
-1
lines changed

app/code/Magento/CatalogImportExport/Model/Export/Product.php

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -712,6 +712,21 @@ public function _getHeaderColumns()
712712
return $this->_customHeadersMapping($this->rowCustomizer->addHeaderColumns($this->_headerColumns));
713713
}
714714

715+
/**
716+
* Return non-system attributes
717+
718+
* @return array
719+
*/
720+
private function getNonSystemAttributes()
721+
{
722+
$attrKeys = [];
723+
foreach ($this->filterAttributeCollection($this->getAttributeCollection()) as $attribute) {
724+
$attrKeys []= $attribute->getAttributeCode();
725+
}
726+
727+
return array_diff($this->_getExportMainAttrCodes(), $this->_customHeadersMapping($attrKeys));
728+
}
729+
715730
/**
716731
* Set headers columns
717732
*
@@ -729,7 +744,10 @@ protected function setHeaderColumns($customOptionsData, $stockItemRows)
729744
) ?
730745
array_intersect(
731746
$this->_getExportMainAttrCodes(),
732-
$this->_customHeadersMapping($this->_getExportAttrCodes())
747+
array_merge(
748+
$this->_customHeadersMapping($this->_getExportAttrCodes()),
749+
$this->getNonSystemAttributes()
750+
)
733751
) :
734752
$this->_getExportMainAttrCodes();
735753

0 commit comments

Comments
 (0)