File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed
app/code/Magento/Bundle/Block/Catalog/Product/View/Type Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -185,6 +185,17 @@ public function getJsonConfig()
185
185
if ($ configValue ) {
186
186
$ defaultValues [$ optionId ] = $ configValue ;
187
187
}
188
+
189
+ $ preConfiguredQtys = $ preConfiguredValues ->getData ("bundle_option_qty/ $ {optionId}" ) ?? [];
190
+ $ selections = $ options [$ optionId ]['selections ' ];
191
+ array_walk ($ selections , function (&$ selection , $ selectionId ) use ($ preConfiguredQtys ) {
192
+ if (is_array ($ preConfiguredQtys ) && isset ($ preConfiguredQtys [$ selectionId ])) {
193
+ $ selection ['qty ' ] = $ preConfiguredQtys [$ selectionId ];
194
+ } else if ((int )$ preConfiguredQtys > 0 ) {
195
+ $ selection ['qty ' ] = $ preConfiguredQtys ;
196
+ }
197
+ });
198
+ $ options [$ optionId ]['selections ' ] = $ selections ;
188
199
}
189
200
$ position ++;
190
201
}
Original file line number Diff line number Diff line change @@ -169,7 +169,9 @@ protected function _getSelectedOptions()
169
169
*/
170
170
protected function assignSelection (\Magento \Bundle \Model \Option $ option , $ selectionId )
171
171
{
172
- if ($ selectionId && $ option ->getSelectionById ($ selectionId )) {
172
+ if (is_array ($ selectionId )) {
173
+ $ this ->_selectedOptions = $ selectionId ;
174
+ } else if ($ selectionId && $ option ->getSelectionById ($ selectionId )) {
173
175
$ this ->_selectedOptions = $ selectionId ;
174
176
} elseif (!$ option ->getRequired ()) {
175
177
$ this ->_selectedOptions = 'None ' ;
You can’t perform that action at this time.
0 commit comments