Skip to content

Commit bc26eb1

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

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

app/code/Magento/AdvancedPricingImportExport/Model/Export/AdvancedPricing.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,9 @@ protected function initTypeModels()
174174
}
175175
if ($model->isSuitable()) {
176176
$this->_productTypeModels[$productTypeName] = $model;
177+
// phpcs:ignore Magento2.Performance.ForeachArrayMerge
177178
$this->_disabledAttrs = array_merge($this->_disabledAttrs, $model->getDisabledAttrs());
179+
// phpcs:ignore Magento2.Performance.ForeachArrayMerge
178180
$this->_indexValueAttributes = array_merge(
179181
$this->_indexValueAttributes,
180182
$model->getIndexValueAttributes()
@@ -199,6 +201,7 @@ protected function initTypeModels()
199201
public function export()
200202
{
201203
//Execution time may be very long
204+
// phpcs:ignore Magento2.Functions.DiscouragedFunction
202205
set_time_limit(0);
203206

204207
$writer = $this->getWriter();
@@ -355,6 +358,7 @@ private function prepareExportData(
355358
$linkedTierPricesData = [];
356359
foreach ($tierPricesData as $tierPriceData) {
357360
$sku = $productLinkIdToSkuMap[$tierPriceData['product_link_id']];
361+
// phpcs:ignore Magento2.Performance.ForeachArrayMerge
358362
$linkedTierPricesData[] = array_merge(
359363
$tierPriceData,
360364
[ImportAdvancedPricing::COL_SKU => $sku]

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,9 @@ protected function initTypeModels()
484484
}
485485
if ($model->isSuitable()) {
486486
$this->_productTypeModels[$productTypeName] = $model;
487+
// phpcs:ignore Magento2.Performance.ForeachArrayMerge
487488
$this->_disabledAttrs = array_merge($this->_disabledAttrs, $model->getDisabledAttrs());
489+
// phpcs:ignore Magento2.Performance.ForeachArrayMerge
488490
$this->_indexValueAttributes = array_merge(
489491
$this->_indexValueAttributes,
490492
$model->getIndexValueAttributes()
@@ -923,6 +925,7 @@ protected function getExportData()
923925
foreach ($rawData as $productId => $productData) {
924926
foreach ($productData as $storeId => $dataRow) {
925927
if ($storeId == Store::DEFAULT_STORE_ID && isset($stockItemRows[$productId])) {
928+
// phpcs:ignore Magento2.Performance.ForeachArrayMerge
926929
$dataRow = array_merge($dataRow, $stockItemRows[$productId]);
927930
}
928931
$this->appendMultirowData($dataRow, $multirawData);

0 commit comments

Comments
 (0)