5
5
*/
6
6
namespace Magento \CatalogImportExport \Model \Import ;
7
7
8
+ use Magento \Catalog \Model \Config as CatalogConfig ;
8
9
use Magento \Catalog \Model \Product \Visibility ;
9
10
use Magento \CatalogImportExport \Model \Import \Product \RowValidatorInterface as ValidatorInterface ;
10
11
use Magento \Framework \App \Filesystem \DirectoryList ;
11
- use Magento \Framework \App \ ObjectManager ;
12
+ use Magento \Framework \Filesystem ;
12
13
use Magento \Framework \Model \ResourceModel \Db \ObjectRelationProcessor ;
13
14
use Magento \Framework \Model \ResourceModel \Db \TransactionManagerInterface ;
14
15
use Magento \Framework \Stdlib \DateTime ;
15
- use Magento \Framework \Filesystem ;
16
16
use Magento \ImportExport \Model \Import ;
17
17
use Magento \ImportExport \Model \Import \Entity \AbstractEntity ;
18
18
use Magento \ImportExport \Model \Import \ErrorProcessing \ProcessingError ;
19
19
use Magento \ImportExport \Model \Import \ErrorProcessing \ProcessingErrorAggregatorInterface ;
20
- use Magento \Catalog \Model \Config as CatalogConfig ;
21
20
22
21
/**
23
22
* Import entity product model
@@ -1293,20 +1292,15 @@ protected function _saveLinks()
1293
1292
*/
1294
1293
protected function _saveProductAttributes (array $ attributesData )
1295
1294
{
1295
+ $ linkField = $ this ->getProductEntityLinkField ();
1296
1296
foreach ($ attributesData as $ tableName => $ skuData ) {
1297
1297
$ tableData = [];
1298
1298
foreach ($ skuData as $ sku => $ attributes ) {
1299
- $ linkId = $ this ->_connection ->fetchOne (
1300
- $ this ->_connection ->select ()
1301
- ->from ($ this ->getResource ()->getTable ('catalog_product_entity ' ))
1302
- ->where ('sku = ? ' , (string )$ sku )
1303
- ->columns ($ this ->getProductEntityLinkField ())
1304
- );
1305
-
1299
+ $ linkId = $ this ->_oldSku [strtolower ($ sku )][$ linkField ];
1306
1300
foreach ($ attributes as $ attributeId => $ storeValues ) {
1307
1301
foreach ($ storeValues as $ storeId => $ storeValue ) {
1308
1302
$ tableData [] = [
1309
- $ this -> getProductEntityLinkField () => $ linkId ,
1303
+ $ linkField => $ linkId ,
1310
1304
'attribute_id ' => $ attributeId ,
1311
1305
'store_id ' => $ storeId ,
1312
1306
'value ' => $ storeValue ,
@@ -1316,6 +1310,7 @@ protected function _saveProductAttributes(array $attributesData)
1316
1310
}
1317
1311
$ this ->_connection ->insertOnDuplicate ($ tableName , $ tableData , ['value ' ]);
1318
1312
}
1313
+
1319
1314
return $ this ;
1320
1315
}
1321
1316
0 commit comments