Magento 2 Certification Questions List | There is plugin where it a product final price is needed. You expects the $product to be an instance of ProductInterface. But It doesn't have method getFinalPrice.MagentoCatalog module's class realizes that interface and it has a method getFinalPrice().

There is plugin where it a product final price is needed. You expects the $product to be an instance of ProductInterface. But It doesn't have method getFinalPrice. MagentoCatalog module's class realizes that interface and it has a method getFinalPrice().

Answer:
  • Add:if (!$product instanceof MagentoCatalogModelProduct) throw new Exception(...)else return $product->getFinalPrice().
Prepear for Magento 2 certefication with our interactive quiz