私は1つのカスタムモジュールを開発し、これら2つのリンクMagento 2でのブロックの上書き とDI&Magento 2でのブロックの拡張をたどって製品ビューブロックを上書きしようとしましたが、製品ビューページにアクセスすると、404ページが表示されます。これまでに行ったことは以下のとおりです
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="TT\Helloworld\Block\Myproduct"/>
   </config>
Myproduct.php
<?php
namespace TT\Helloworld\Block;
use Magento\Framework\View\Element\Template;
use Magento\Catalog\Api\ProductRepositoryInterface;
use Magento\Catalog\Model\Product;
class Myproduct extends \Magento\Catalog\Block\Product\View
{
protected $_helper;
protected $_objectManager;
public function __construct(
        \Magento\Catalog\Block\Product\Context $context,
        \Magento\Framework\Url\EncoderInterface $urlEncoder,
        \Magento\Framework\Json\EncoderInterface $jsonEncoder,
        \Magento\Framework\Stdlib\StringUtils $string,
        \Magento\Catalog\Helper\Product $productHelper,
        \Magento\Catalog\Model\ProductTypes\ConfigInterface $productTypeConfig,
        \Magento\Framework\Locale\FormatInterface $localeFormat,
        \Magento\Customer\Model\Session $customerSession,
        ProductRepositoryInterface $productRepository,
        \Magento\Framework\Pricing\PriceCurrencyInterface $priceCurrency,
        array $data = [],
        \TT\Helloworld\Helper\Data $helper  
) {
    parent::__construct($context, $urlEncoder, $jsonEncoder, $string, $productHelper, $productTypeConfig, $localeFormat, $customerSession, $productRepository, $priceCurrency, $data,$helper);
    $this->_helper = $helper;
}
protected function _toHtml()
{
    $this->setModuleName($this->extractModuleName('Magento\Catalog\Block\Product\View'));
    return parent::_toHtml();
}
Magento 2リンクでのDIとブロックの拡張に従って、Myproduct.phpコンストラクターにすべての親クラスコンストラクターパラメーターも含めました。
誰かがどこが間違っているか知っていますか?またはこれを上書きする正しい方法は何ですか?
                  あなたはあなたの解決策がリンクに従っているのを見つけるでしょう。magento.stackexchange.com/questions/86497/...
                
                
                  
                    —
                    アナンドOntigeri 
                    
                  
                
              
                  @AnandOntigeriそのソリューションも機能しない場合は、ここにソリューションを追加できますか?
                
                
                  
                    —
                    chirag dodia 16年
                    
                  
                
              TT\Helloworld\Block\Myproduct.php==> TT\Helloworld\Block\Myproduct(削除.php)
                
                  @ BriceC.thatも機能しない
                
                
                  
                    —
                    chirag dodia 
                    
                  
                
              
                  メソッドを削除
                
                  
                    —
                    bchatard 
                    
                  
                
              C:\xampp\htdocs\Magento2\var\generation\TT\Helloworld\Block\Myproduct\Interceptor.phpしてコメントし、__constructもう一度試してください