Skip to content

Commit 40b8d2c

Browse files
committed
Merge branch 'MAGNIMEX-120-integration-tests-changes' into 'master'
Magnimex 120 integration tests changes See merge request !164
2 parents f6a6083 + f78f123 commit 40b8d2c

File tree

3 files changed

+10
-3
lines changed
  • app/code/Magento
  • dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/Product/Type

3 files changed

+10
-3
lines changed

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1324,10 +1324,14 @@ protected function _saveProducts()
13241324
}
13251325
}
13261326

1327+
$this->websitesCache[$rowSku] = [];
13271328
// 2. Product-to-Website phase
13281329
if (!empty($rowData[self::COL_PRODUCT_WEBSITES])) {
1329-
$websiteId = $this->storeResolver->getWebsiteCodeToId($rowData[self::COL_PRODUCT_WEBSITES]);
1330-
$this->websitesCache[$rowSku][$websiteId] = true;
1330+
$websiteIds = explode($this->getMultipleValueSeparator(), $rowData[self::COL_PRODUCT_WEBSITES]);
1331+
foreach ($websiteIds as $websiteId) {
1332+
$websiteId = $this->storeResolver->getWebsiteCodeToId($rowData[self::COL_PRODUCT_WEBSITES]);
1333+
$this->websitesCache[$rowSku][$websiteId] = true;
1334+
}
13311335
}
13321336

13331337
// 3. Categories phase

app/code/Magento/CatalogUrlRewrite/Model/Product/Plugin/Import.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,9 @@ protected function _populateForUrlGeneration($rowData)
183183
$this->websitesToStoreIds[$websiteId] = $this->storeManager->getWebsite($websiteId)->getStoreIds();
184184
}
185185
}
186-
if ($storeId = $this->import->getStoreIdByCode($rowData[ImportProduct::COL_STORE])) {
186+
if (!empty($rowData[ImportProduct::COL_STORE])
187+
&& ($storeId = $this->import->getStoreIdByCode($rowData[ImportProduct::COL_STORE]))
188+
) {
187189
$product->setStoreId($storeId);
188190
}
189191
if ($this->isGlobalScope($product->getStoreId())) {

dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/Product/Type/AbstractTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ protected function setUp()
2525
[
2626
$objectManager->get('Magento\Eav\Model\Resource\Entity\Attribute\Set\CollectionFactory'),
2727
$objectManager->get('Magento\Catalog\Model\Resource\Product\Attribute\CollectionFactory'),
28+
$objectManager->get('Magento\Framework\App\Resource'),
2829
$params
2930
]
3031
);

0 commit comments

Comments
 (0)