Skip to content

Commit 163efae

Browse files
committed
MAGETWO-56695: Paypal checkout not possible with products that have custom options #5938 - for 2.1
1 parent edf5ffb commit 163efae

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

app/code/Magento/Catalog/Model/Product.php

+5-2
Original file line numberDiff line numberDiff line change
@@ -1905,15 +1905,18 @@ public function addOption(Product\Option $option)
19051905
*/
19061906
public function getOptionById($optionId)
19071907
{
1908+
$result = null;
19081909
if (is_array($this->getOptions())) {
19091910
/** @var \Magento\Catalog\Model\Product\Option $option */
19101911
foreach ($this->getOptions() as $option) {
19111912
if ($option->getId() == $optionId) {
1912-
return $option;
1913+
$result = $option;
1914+
break;
19131915
}
19141916
}
19151917
}
1916-
return null;
1918+
1919+
return $result;
19171920
}
19181921

19191922
/**

0 commit comments

Comments
 (0)