File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
app/code/Magento/CatalogImportExport/Model/Import Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -1192,8 +1192,10 @@ protected function _initTypeModels()
1192
1192
if ($ model ->isSuitable ()) {
1193
1193
$ this ->_productTypeModels [$ productTypeName ] = $ model ;
1194
1194
}
1195
+ // phpcs:disable Magento2.Performance.ForeachArrayMerge.ForeachArrayMerge
1195
1196
$ this ->_fieldsMap = array_merge ($ this ->_fieldsMap , $ model ->getCustomFieldsMapping ());
1196
1197
$ this ->_specialAttributes = array_merge ($ this ->_specialAttributes , $ model ->getParticularAttributes ());
1198
+ // phpcs:enable
1197
1199
}
1198
1200
$ this ->_initErrorTemplates ();
1199
1201
// remove doubles
@@ -2972,6 +2974,10 @@ private function formatStockDataForRow(array $rowData): array
2972
2974
$ stockItemDo = $ this ->stockRegistry ->getStockItem ($ row ['product_id ' ], $ row ['website_id ' ]);
2973
2975
$ existStockData = $ stockItemDo ->getData ();
2974
2976
2977
+ if (isset ($ rowData ['qty ' ]) && $ rowData ['qty ' ] == 0 && !isset ($ rowData ['is_in_stock ' ])) {
2978
+ $ rowData ['is_in_stock ' ] = 0 ;
2979
+ }
2980
+
2975
2981
$ row = array_merge (
2976
2982
$ this ->defaultStockData ,
2977
2983
array_intersect_key ($ existStockData , $ this ->defaultStockData ),
You can’t perform that action at this time.
0 commit comments