File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
app/code/Magento/Bundle/Ui/DataProvider/Product/Form/Modifier Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -24,12 +24,13 @@ class AddSelectionQtyTypeToProductsData implements ModifierInterface
24
24
private StockRegistryPreloader $ stockRegistryPreloader ;
25
25
26
26
/**
27
- * Construct
27
+ * Initializes dependencies
28
28
*
29
+ * @param StockRegistryPreloader $stockRegistryPreloader
29
30
*/
30
- public function __construct ()
31
+ public function __construct (StockRegistryPreloader $ stockRegistryPreloader )
31
32
{
32
- $ this ->stockRegistryPreloader = ObjectManager:: getInstance ()-> get (StockRegistryPreloader::class) ;
33
+ $ this ->stockRegistryPreloader = $ stockRegistryPreloader ;
33
34
}
34
35
35
36
/**
@@ -63,10 +64,10 @@ public function modifyData(array $data): array
63
64
foreach ($ stockItems as $ stockItem ) {
64
65
$ isQtyDecimals [$ stockItem ->getProductId ()] = $ stockItem ->getIsQtyDecimal ();
65
66
}
66
-
67
+
67
68
foreach ($ data ['items ' ] as &$ item ) {
68
- if ($ isQtyDecimals [$ item ['entity_id ' ]]) {
69
- $ item ['selection_qty_is_integer ' ] = false ;
69
+ if (isset ( $ isQtyDecimals [$ item ['entity_id ' ]]) ) {
70
+ $ item ['selection_qty_is_integer ' ] = ! $ isQtyDecimals [ $ item [ ' entity_id ' ]] ;
70
71
}
71
72
}
72
73
You can’t perform that action at this time.
0 commit comments