Skip to content

Commit d0c3fc2

Browse files
committed
MC-41810: Cannot add bundle product with more than 1 checkbox option to the cart via Graphql
1 parent f6bd430 commit d0c3fc2

File tree

1 file changed

+6
-2
lines changed
  • app/code/Magento/Bundle/Model/Product

1 file changed

+6
-2
lines changed

app/code/Magento/Bundle/Model/Product/Type.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1231,8 +1231,12 @@ public function getIdentities(\Magento\Catalog\Model\Product $product)
12311231
protected function getQty($selection, $qtys, $selectionOptionId)
12321232
{
12331233
if ($selection->getSelectionCanChangeQty() && isset($qtys[$selectionOptionId])) {
1234-
$selectionQty = $qtys[$selectionOptionId][$selection->getSelectionId()];
1235-
$qty = (float)$selectionQty > 0 ? $selectionQty : 1;
1234+
if (is_array($qtys[$selectionOptionId]) && isset($qtys[$selectionOptionId][$selection->getSelectionId()])) {
1235+
$selectionQty = $qtys[$selectionOptionId][$selection->getSelectionId()];
1236+
$qty = (float)$selectionQty > 0 ? $selectionQty : 1;
1237+
} else {
1238+
$qty = (float)$qtys[$selectionOptionId] > 0 ? $qtys[$selectionOptionId] : 1;
1239+
}
12361240
} else {
12371241
$qty = (float)$selection->getSelectionQty() ? $selection->getSelectionQty() : 1;
12381242
}

0 commit comments

Comments
 (0)