Skip to content

Commit 932193a

Browse files
author
Novykov Ivan
committed
MDVA-117: Not able to export or import
1 parent b8c09a7 commit 932193a

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

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

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -531,15 +531,21 @@ protected function processCountExistingPrices($prices, $table)
531531
{
532532
$existingPrices = $this->_connection->fetchAssoc(
533533
$this->_connection->select()->from(
534-
$this->_connection->getTableName($table),
534+
['t' => $this->_connection->getTableName($table)],
535535
['value_id', 'entity_id', 'all_groups', 'customer_group_id']
536536
)
537+
->joinInner(
538+
['e' => $this->_connection->getTableName('catalog_product_entity')],
539+
't.entity_id = e.entity_id',
540+
['e.sku']
541+
)
542+
->where(
543+
$this->_connection->quoteInto('e.sku IN (?)', array_keys($prices))
544+
)
537545
);
538546
foreach ($existingPrices as $existingPrice) {
539-
foreach ($this->_oldSkus as $sku => $productId) {
540-
if ($existingPrice['entity_id'] == $productId && isset($prices[$sku])) {
541-
$this->incrementCounterUpdated($prices[$sku], $existingPrice);
542-
}
547+
if (isset($prices[$existingPrice['sku']])) {
548+
$this->incrementCounterUpdated($prices[$existingPrice['sku']], $existingPrice);
543549
}
544550
}
545551

0 commit comments

Comments
 (0)