File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
app/code/Magento/CatalogImportExport/Model/Import Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -3062,7 +3062,7 @@ private function formatStockDataForRow(array $rowData): array
3062
3062
$ stockItemDo = $ this ->stockRegistry ->getStockItem ($ row ['product_id ' ], $ row ['website_id ' ]);
3063
3063
$ existStockData = $ stockItemDo ->getData ();
3064
3064
3065
- if (isset ($ rowData ['qty ' ]) && $ rowData ['qty ' ] == 0 ) {
3065
+ if (isset ($ rowData ['qty ' ]) && $ rowData ['qty ' ] == 0 && ! isset ( $ rowData [ ' is_in_stock ' ]) ) {
3066
3066
$ rowData ['is_in_stock ' ] = 0 ;
3067
3067
}
3068
3068
@@ -3074,6 +3074,9 @@ private function formatStockDataForRow(array $rowData): array
3074
3074
);
3075
3075
3076
3076
if ($ this ->stockConfiguration ->isQty ($ this ->skuProcessor ->getNewSku ($ sku )['type_id ' ])) {
3077
+ if (isset ($ rowData ['qty ' ]) && $ rowData ['qty ' ] == 0 ) {
3078
+ $ row ['is_in_stock ' ] = 0 ;
3079
+ }
3077
3080
$ stockItemDo ->setData ($ row );
3078
3081
$ row ['is_in_stock ' ] = $ row ['is_in_stock ' ] ?? $ this ->stockStateProvider ->verifyStock ($ stockItemDo );
3079
3082
if ($ this ->stockStateProvider ->verifyNotification ($ stockItemDo )) {
You can’t perform that action at this time.
0 commit comments