File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
app/code/Magento/Bundle/Block/Catalog/Product/View/Type Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -185,6 +185,18 @@ public function getJsonConfig()
185185 if ($ configValue ) {
186186 $ defaultValues [$ optionId ] = $ configValue ;
187187 }
188+
189+
190+ $ preConfiguredQtys = $ preConfiguredValues ->getData ("bundle_option_qty/ $ {optionId}" ) ?? [];
191+ $ selections = $ options [$ optionId ]['selections ' ];
192+ array_walk ($ selections , function (&$ selection , $ selectionId ) use ($ preConfiguredQtys ) {
193+ if (is_array ($ preConfiguredQtys ) && isset ($ preConfiguredQtys [$ selectionId ])) {
194+ $ selection ['qty ' ] = $ preConfiguredQtys [$ selectionId ];
195+ } else if ((int )$ preConfiguredQtys > 0 ) {
196+ $ selection ['qty ' ] = $ preConfiguredQtys ;
197+ }
198+ });
199+ $ options [$ optionId ]['selections ' ] = $ selections ;
188200 }
189201 $ position ++;
190202 }
You can’t perform that action at this time.
0 commit comments