I need to override product view block but i got an error :
Here's my di.xml :
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd">
<preference for="Magento\Catalog\Block\Product\View" type="Magento\Module_Inject_Session\Block\Product\View"/>
</config>
Here's my new block :
And there is this error and I have no idea what to do about it :
anyone one know where i'm wrong? or what is the correct way to override this file?
Best Answer
Try with below solutions, Replace _ with folder and separate each folder path like below,
Set your block php file at below location,
app/code/Magento/Module/Inject/Session/Block/Product/View.php
inside php file,