Skip to content

Commit 9365393

Browse files
committed
Variable as a method parameter might be overridden by the loop
1 parent 0c2fa6f commit 9365393

File tree

1 file changed

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

1 file changed

+4
-4
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -534,12 +534,12 @@ public function updateQtyOption($options, \Magento\Framework\DataObject $option,
534534

535535
foreach ($selections as $selection) {
536536
if ($selection->getProductId() == $optionProduct->getId()) {
537-
foreach ($options as &$option) {
538-
if ($option->getCode() == 'selection_qty_' . $selection->getSelectionId()) {
537+
foreach ($options as $quoteItemOption) {
538+
if ($quoteItemOption->getCode() == 'selection_qty_' . $selection->getSelectionId()) {
539539
if ($optionUpdateFlag) {
540-
$option->setValue(intval($option->getValue()));
540+
$quoteItemOption->setValue(intval($quoteItemOption->getValue()));
541541
} else {
542-
$option->setValue($value);
542+
$quoteItemOption->setValue($value);
543543
}
544544
}
545545
}

0 commit comments

Comments
 (0)