File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -83,8 +83,10 @@ public function mapByProduct(ProductInterface $product): array
8383 }
8484
8585 $ productData ['price ' ] = $ this ->priceFormatter ->format ((float ) $ product ->getPriceInfo ()->getPrice (FinalPrice::PRICE_CODE )->getValue ());
86- if ($ product ->getCustomOption ('simple_product ' ) && $ product ->getCustomOption ('simple_product ' )->getProduct ()) {
87- $ simpleProduct = $ product ->getCustomOption ('simple_product ' )->getProduct ();
86+
87+ $ simpleProductOption = $ product ->getCustomOption ('simple_product ' );
88+ if ($ simpleProductOption && method_exists ($ simpleProductOption , 'getProduct ' ) && $ simpleProductOption ->getProduct ()) {
89+ $ simpleProduct = $ simpleProductOption ->getProduct ();
8890 $ productData ['price ' ] = $ this ->priceFormatter ->format ((float ) $ simpleProduct ->getPriceInfo ()->getPrice (FinalPrice::PRICE_CODE )->getValue ());
8991 }
9092
You can’t perform that action at this time.
0 commit comments