Open eLoner opened 6 years ago
Hello eLoner, thank you for the comment. Can you please point more specific what to add and what to replace and where? My file 'Observer/DefaultProductMeta.php' is like below now, with the changes you suggest:
I hope you can help me, thank you so much.
"/app/code/Fox/Seo/Observer/DefaultProductMeta.php(38): Fox\Seo\Helper\Data->checkMetaData(NULL, 'category')"
i got an exception on a product page, file Observer/DfaultProductMeta.php this is original code: `/**
*/ public function execute(\Magento\Framework\Event\Observer $observer) { $category = $observer->getEvent()->getCategory();
}`
here is wrong method getCategory(), it should be getProduct(), "catalog_controller_product_init_after" event is also dispatches the data for it Magento_Catalog\Helper\Product.php:
try { $this->_eventManager->dispatch( 'catalog_controller_product_init_after', ['product' => $product, 'controller_action' => $controller] ); } catch (\Magento\Framework\Exception\LocalizedException $e) { $this->_logger->critical($e); return false; }