File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
app/code/Magento/ConfigurableProduct/Model/Product/Type/Configurable Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -39,10 +39,15 @@ public function getFinalPrice($qty, $product)
39
39
*/
40
40
public function getPrice ($ product )
41
41
{
42
- if ( !empty ( $ product ) && !empty ( $ product ->getCustomOption ('simple_product ' ) ) && !empty ( $ product ->getCustomOption ('simple_product ' )->getProduct () ) ) {
43
- return $ product ->getCustomOption ('simple_product ' )->getProduct ()->getPrice ();
44
- } else {
45
- return 0 ;
42
+ if ( !empty ( $ product ) ) {
43
+ $ simpleProductOption = $ product ->getCustomOption ('simple_product ' );
44
+ if ( !empty ( $ simpleProductOption ) ) {
45
+ $ simpleProduct = $ simpleProductOption ->getProduct ();
46
+ if ( !empty ( $ simpleProduct ) ) {
47
+ return $ simpleProduct ->getPrice ();
48
+ }
49
+ }
46
50
}
51
+ return 0 ;
47
52
}
48
53
}
You can’t perform that action at this time.
0 commit comments