Skip to content

Commit 45153d7

Browse files
authored
Merge pull request #230 from webidea24/fix/configurable-fallback
checkout: prevent configurable fallback on "0"-value
2 parents 2212686 + 730ed7d commit 45153d7

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

Plugin/Catalog/Helper/Product/Configuration/AddVisibleInCheckoutAttributesToCustomOptionsPlugin.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,10 @@ public function afterGetCustomOptions(Configuration $configuration, array $custo
8484
$children = $item->getChildren();
8585
if ($children[0] instanceof AbstractItem && $children[0]->getProduct()) {
8686
// fetch the attribute value of the child
87-
$value = $attributeFrontend->getValue($children[0]->getProduct()) ?: $value;
87+
$childValue = $attributeFrontend->getValue($children[0]->getProduct());
88+
// Be careful: "0" is a valid value for setting a yes/no attribute to false, so the check must be
89+
// against explicit null
90+
$value = $childValue === null ? $value : $childValue;
8891
}
8992
}
9093

0 commit comments

Comments
 (0)