Skip to content

Commit 32058a0

Browse files
author
Dmytro Voskoboinikov
committed
MAGETWO-64547: Bundle Products - The options you selected are not available
1 parent 4937c18 commit 32058a0

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

app/code/Magento/Bundle/Block/Catalog/Product/View/Type/Bundle/Option.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,14 +143,16 @@ protected function _getSelectedOptions()
143143
{
144144
if (is_null($this->_selectedOptions)) {
145145
$this->_selectedOptions = [];
146+
147+
/** @var \Magento\Bundle\Model\Option $option */
146148
$option = $this->getOption();
147149

148150
if ($this->getProduct()->hasPreconfiguredValues()) {
149-
$configValue = $this->getProduct()->getPreconfiguredValues()->getData(
151+
$selectionId = $this->getProduct()->getPreconfiguredValues()->getData(
150152
'bundle_option/' . $option->getId()
151153
);
152-
if ($configValue) {
153-
$this->_selectedOptions = $configValue;
154+
if ($selectionId && $option->getSelectionById($selectionId)) {
155+
$this->_selectedOptions = $selectionId;
154156
} elseif (!$option->getRequired()) {
155157
$this->_selectedOptions = 'None';
156158
}

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,6 @@ public function removeChild($sku, $optionId, $childSku)
308308
continue;
309309
}
310310
$excludeSelectionIds[] = $selection->getSelectionId();
311-
$usedProductIds[] = $selection->getProductId();
312311
}
313312
}
314313
if (empty($removeSelectionIds)) {

0 commit comments

Comments
 (0)