Skip to content

Commit 26e8eee

Browse files
committed
MC-35690: [B2B] Unexpected results of editing of a Bundle Product in the Shopping Cart, added from a Requisition List
1 parent d461708 commit 26e8eee

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

app/code/Magento/Bundle/Model/CartItemProcessor.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ public function processOptions(CartItemInterface $cartItem)
8383
}
8484
$productOptions = [];
8585
$bundleOptions = $cartItem->getBuyRequest()->getBundleOption();
86-
$bundleOptionsQty = $cartItem->getBuyRequest()->getBundleOptionQty() ?? [];
86+
$bundleOptionsQty = $cartItem->getBuyRequest()->getBundleOptionQty();
87+
$bundleOptionsQty = is_array($bundleOptionsQty) ? $bundleOptionsQty : [];
8788
if (is_array($bundleOptions)) {
8889
foreach ($bundleOptions as $optionId => $optionSelections) {
8990
if (empty($optionSelections)) {
@@ -95,7 +96,7 @@ public function processOptions(CartItemInterface $cartItem)
9596
$productOption = $this->bundleOptionFactory->create();
9697
$productOption->setOptionId($optionId);
9798
$productOption->setOptionSelections($optionSelections);
98-
if (is_array($bundleOptionsQty) && isset($bundleOptionsQty[$optionId])) {
99+
if (isset($bundleOptionsQty[$optionId])) {
99100
$productOption->setOptionQty($bundleOptionsQty[$optionId]);
100101
}
101102
$productOptions[] = $productOption;

0 commit comments

Comments
 (0)