I'm extending catalog product edit page for this I have extended the Edit.php file from vendor/magento-catalog/block/adminhtml/product. My Changes is applying, but when i save the product it's not saving.
Same functionality working in first released Magento 2 ver 1.0.0 beta, but it's not working in recently released both MEE and MCE (ver 2.0.0 and 2.0.2).
For this I have written code as below.
Learning/Custom/etc/module.xml
<?xml version="1.0"?> <!-- /** * Copyright © 2015 Magento. All rights reserved. * See COPYING.txt for license details. */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Learning_Custom" setup_version="1.0.0"> <sequence> <module name="Magento_Catalog"/> </sequence> </module> </config> Learning/Custom/Block/Adminhtml/Product/ProductEdit.php
<?php namespace Learning\Custom\Block\Adminhtml\Product; use \Magento\Catalog\Block\Adminhtml\Product\Edit; class ProductEdit extends Edit { /** * @var string */ protected $_template = 'catalog/product/edit.phtml'; } Learning/Custom/etc/di.xml
<?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="Magento\Catalog\Block\Adminhtml\Product\Edit" type="Learning\Custom\Block\Adminhtml\Product\ProductEdit"/> </config> Learning/Custom/view/adminhtml/templates/catalog/product/edit.phtml
<h1> Hi I'm extending product edit page</h1> .... //below is the product edit.phtml file coding here i'm not posting. I have cleared the cache and I have ran php bin/magento setup:static-content:deploy. But still no luck.
Could you please suggest me on this?
Learning/Custom/Block/Adminhtml/Product/Edit.phpshould beLearning/Custom/Block/Adminhtml/Product/ProductEdit.php$_template = 'Learning_Custom::catalog/product/edit.phtml'