We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c05ac4c commit 076bb60Copy full SHA for 076bb60
app/code/Magento/Bundle/Block/Catalog/Product/View/Type/Bundle.php
@@ -185,6 +185,18 @@ public function getJsonConfig()
185
if ($configValue) {
186
$defaultValues[$optionId] = $configValue;
187
}
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;
200
201
$position++;
202
0 commit comments