We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent edf5ffb commit 163efaeCopy full SHA for 163efae
app/code/Magento/Catalog/Model/Product.php
@@ -1905,15 +1905,18 @@ public function addOption(Product\Option $option)
1905
*/
1906
public function getOptionById($optionId)
1907
{
1908
+ $result = null;
1909
if (is_array($this->getOptions())) {
1910
/** @var \Magento\Catalog\Model\Product\Option $option */
1911
foreach ($this->getOptions() as $option) {
1912
if ($option->getId() == $optionId) {
- return $option;
1913
+ $result = $option;
1914
+ break;
1915
}
1916
1917
- return null;
1918
+
1919
+ return $result;
1920
1921
1922
/**
0 commit comments