We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 309b4be + 6752968 commit a86e9b0Copy full SHA for a86e9b0
app/code/Magento/ConfigurableProduct/Model/Product/Type/Configurable/Price.php
@@ -39,10 +39,15 @@ public function getFinalPrice($qty, $product)
39
*/
40
public function getPrice($product)
41
{
42
- if ($product->getCustomOption('simple_product')) {
43
- return $product->getCustomOption('simple_product')->getProduct()->getPrice();
44
- } else {
45
- return 0;
+ if (!empty($product)) {
+ $simpleProductOption = $product->getCustomOption('simple_product');
+ if (!empty($simpleProductOption)) {
+ $simpleProduct = $simpleProductOption->getProduct();
46
+ if (!empty($simpleProduct)) {
47
+ return $simpleProduct->getPrice();
48
+ }
49
50
}
51
+ return 0;
52
53
0 commit comments