File tree Expand file tree Collapse file tree 1 file changed +11
-14
lines changed
app/code/Magento/CatalogImportExport/Model/Import Expand file tree Collapse file tree 1 file changed +11
-14
lines changed Original file line number Diff line number Diff line change @@ -1472,21 +1472,18 @@ protected function _saveProducts()
1472
1472
];
1473
1473
}
1474
1474
}
1475
- } else {
1476
- foreach ($ this ->_imagesArrayKeys as $ imageCol ) {
1477
- if (!empty ($ rowData [$ imageCol ]) && ($ rowData [$ imageCol ] == $ imagePath )) {
1478
- $ rowData [$ imageCol ] = '' ;
1479
- }
1480
- }
1481
1475
}
1482
- if (!isset ($ existingImages [$ imagePath ]) || in_array ($ rowSku , $ existingImages [$ imagePath ])) {
1483
- foreach ($ this ->_imagesArrayKeys as $ imageCol ) {
1484
- if (!empty ($ rowData [$ imageCol ])
1485
- && ($ imageCol != self ::COL_MEDIA_IMAGE )
1486
- && isset ($ uploadedGalleryFiles [$ rowData [$ imageCol ]])
1487
- ) {
1488
- $ rowData [$ imageCol ] = $ uploadedGalleryFiles [$ rowData [$ imageCol ]];
1489
- }
1476
+ foreach ($ this ->_imagesArrayKeys as $ imageCol ) {
1477
+ if (empty ($ rowData [$ imageCol ]) || ($ imageCol == self ::COL_MEDIA_IMAGE )) {
1478
+ continue ;
1479
+ }
1480
+ if (isset ($ existingImages [$ imagePath ])
1481
+ && !in_array ($ rowSku , $ existingImages [$ imagePath ])
1482
+ && (($ rowData [$ imageCol ] == $ imagePath ) || ($ rowData [$ imageCol ] == $ mediaImage ))
1483
+ ) {
1484
+ unset($ rowData [$ imageCol ]);
1485
+ } elseif (isset ($ uploadedGalleryFiles [$ rowData [$ imageCol ]])) {
1486
+ $ rowData [$ imageCol ] = $ uploadedGalleryFiles [$ rowData [$ imageCol ]];
1490
1487
}
1491
1488
}
1492
1489
}
You can’t perform that action at this time.
0 commit comments