File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
app/code/Magento/Catalog/Controller/Adminhtml/Product/Initialization Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -46,7 +46,6 @@ public function __construct(
46
46
*
47
47
* @param array $stockData
48
48
* @return array
49
- * @throws Exception
50
49
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
51
50
*/
52
51
public function filter (array $ stockData )
@@ -65,15 +64,27 @@ public function filter(array $stockData)
65
64
if (isset ($ stockData ['min_qty ' ]) && (int )$ stockData ['min_qty ' ] < 0 ) {
66
65
$ stockData ['min_qty ' ] = 0 ;
67
66
}
67
+ $ this ->allowMultipleBoxesForShippingCheck ($ stockData );
68
+ return $ stockData ;
69
+ }
68
70
71
+ /**
72
+ * Allow Multiple Boxes For Shipping Check
73
+ *
74
+ * @param array $stockData
75
+ * @return array
76
+ * @throws Exception
77
+ */
78
+ public function allowMultipleBoxesForShippingCheck (array $ stockData ): array
79
+ {
69
80
if ((isset ($ stockData ['is_decimal_divided ' ]) && isset ($ stockData ['is_qty_decimal ' ]))
70
81
&& $ stockData ['is_qty_decimal ' ] == 0 && $ stockData ['is_decimal_divided ' ] == 1 ) {
71
82
// phpcs:ignore Magento2.Exceptions.DirectThrow
72
83
throw new Exception (__ ('Please select Advanced Inventory -> Qty Uses Decimals as YES. ' ));
73
84
} else if (!isset ($ stockData ['is_decimal_divided ' ]) || $ stockData ['is_qty_decimal ' ] == 0 ) {
74
85
$ stockData ['is_decimal_divided ' ] = 0 ;
75
86
}
76
-
77
87
return $ stockData ;
78
88
}
89
+
79
90
}
You can’t perform that action at this time.
0 commit comments