5
5
*/
6
6
namespace Magento \Catalog \Controller \Adminhtml \Product \Initialization ;
7
7
8
- use Exception ;
9
8
use Magento \CatalogInventory \Api \StockConfigurationInterface ;
10
9
use Magento \Framework \App \Config \ScopeConfigInterface ;
11
10
12
11
/**
13
- * Class StockDataFilter to Filter stock data
12
+ * Class StockDataFilter
14
13
*/
15
14
class StockDataFilter
16
15
{
17
16
/**
18
17
* The greatest value which could be stored in CatalogInventory Qty field
19
18
*/
20
- public const MAX_QTY_VALUE = 99999999 ;
19
+ const MAX_QTY_VALUE = 99999999 ;
21
20
22
21
/**
23
22
* @var ScopeConfigInterface
@@ -47,7 +46,6 @@ public function __construct(
47
46
* @param array $stockData
48
47
* @return array
49
48
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
50
- * @throws Exception
51
49
*/
52
50
public function filter (array $ stockData )
53
51
{
@@ -65,28 +63,10 @@ public function filter(array $stockData)
65
63
if (isset ($ stockData ['min_qty ' ]) && (int )$ stockData ['min_qty ' ] < 0 ) {
66
64
$ stockData ['min_qty ' ] = 0 ;
67
65
}
68
- $ this ->allowMultipleBoxesForShippingCheck ($ stockData );
69
66
70
67
if (!isset ($ stockData ['is_decimal_divided ' ]) || $ stockData ['is_qty_decimal ' ] == 0 ) {
71
68
$ stockData ['is_decimal_divided ' ] = 0 ;
72
69
}
73
70
return $ stockData ;
74
71
}
75
-
76
- /**
77
- * Allow Multiple Boxes For Shipping Check
78
- *
79
- * @param array $stockData
80
- * @return array
81
- * @throws Exception
82
- */
83
- public function allowMultipleBoxesForShippingCheck (array $ stockData ): array
84
- {
85
- if ((isset ($ stockData ['is_decimal_divided ' ]) && isset ($ stockData ['is_qty_decimal ' ]))
86
- && $ stockData ['is_qty_decimal ' ] == 0 && $ stockData ['is_decimal_divided ' ] == 1 ) {
87
- // phpcs:ignore Magento2.Exceptions.DirectThrow
88
- throw new Exception (__ ('Please select Advanced Inventory -> Qty Uses Decimals as YES. ' ));
89
- }
90
- return $ stockData ;
91
- }
92
72
}
0 commit comments