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

Commit d571207

Browse files
author
Oleksandr Gorkun
committed
MAGETWO-72864: Impossible to export Advanced Prices on a medium profile
1 parent 8556809 commit d571207

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

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

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -270,17 +270,13 @@ protected function getExportData()
270270
$productsByStores = $this->loadCollection();
271271
if (!empty($productsByStores)) {
272272
$productLinkField = $this->getProductEntityLinkField();
273-
$anyStoreId = Store::DEFAULT_STORE_ID;
273+
/** @var string[] $productLinkIds */
274+
$productLinkIds = [];
274275

275-
$productLinkIds = array_map(
276-
function (array $productData) use (
277-
$anyStoreId,
278-
$productLinkField
279-
) {
280-
return $productData[$anyStoreId][$productLinkField];
281-
},
282-
$productsByStores
283-
);
276+
foreach ($productsByStores as $productByStores) {
277+
$productLinkIds[]
278+
= array_pop($productByStores)[$productLinkField];
279+
}
284280
$productLinkIds = array_unique($productLinkIds);
285281
$tierPricesData = $this->fetchTierPrices($productLinkIds);
286282
$exportData = $this->prepareExportData(
@@ -364,7 +360,6 @@ private function prepareExportData(
364360
$productLinkIdToSkuMap[$productData[Store::DEFAULT_STORE_ID][$this->getProductEntityLinkField()]]
365361
= $productData[Store::DEFAULT_STORE_ID]['sku'];
366362
}
367-
unset($productData);
368363

369364
//Adding products' SKUs to tier price data.
370365
$linkedTierPricesData = [];
@@ -375,7 +370,6 @@ private function prepareExportData(
375370
[ImportAdvancedPricing::COL_SKU => $sku]
376371
);
377372
}
378-
unset($sku, $tierPriceData);
379373

380374
//Formatting data for export.
381375
$customExportData = [];

0 commit comments

Comments
 (0)