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
2424 private StockRegistryPreloader $ stockRegistryPreloader ;
2525
2626 /**
27- * Construct
27+ * Initializes dependencies
2828 *
29+ * @param StockRegistryPreloader $stockRegistryPreloader
2930 */
30- public function __construct ()
31+ public function __construct (StockRegistryPreloader $ stockRegistryPreloader )
3132 {
32- $ this ->stockRegistryPreloader = ObjectManager:: getInstance ()-> get (StockRegistryPreloader::class) ;
33+ $ this ->stockRegistryPreloader = $ stockRegistryPreloader ;
3334 }
3435
3536 /**
@@ -63,10 +64,10 @@ public function modifyData(array $data): array
6364 foreach ($ stockItems as $ stockItem ) {
6465 $ isQtyDecimals [$ stockItem ->getProductId ()] = $ stockItem ->getIsQtyDecimal ();
6566 }
66-
67+
6768 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 ' ]] ;
7071 }
7172 }
7273
You can’t perform that action at this time.
0 commit comments