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()
11921192 if ($ model ->isSuitable ()) {
11931193 $ this ->_productTypeModels [$ productTypeName ] = $ model ;
11941194 }
1195+ // phpcs:disable Magento2.Performance.ForeachArrayMerge.ForeachArrayMerge
11951196 $ this ->_fieldsMap = array_merge ($ this ->_fieldsMap , $ model ->getCustomFieldsMapping ());
11961197 $ this ->_specialAttributes = array_merge ($ this ->_specialAttributes , $ model ->getParticularAttributes ());
1198+ // phpcs:enable
11971199 }
11981200 $ this ->_initErrorTemplates ();
11991201 // remove doubles
@@ -2972,6 +2974,10 @@ private function formatStockDataForRow(array $rowData): array
29722974 $ stockItemDo = $ this ->stockRegistry ->getStockItem ($ row ['product_id ' ], $ row ['website_id ' ]);
29732975 $ existStockData = $ stockItemDo ->getData ();
29742976
2977+ if (isset ($ rowData ['qty ' ]) && $ rowData ['qty ' ] == 0 && !isset ($ rowData ['is_in_stock ' ])) {
2978+ $ rowData ['is_in_stock ' ] = 0 ;
2979+ }
2980+
29752981 $ row = array_merge (
29762982 $ this ->defaultStockData ,
29772983 array_intersect_key ($ existStockData , $ this ->defaultStockData ),
You can’t perform that action at this time.
0 commit comments