Vendor\magento\module-customer\view\frontend\templates\widget\name.phtml
override into my custom module
mycompany\custommodule\view\frontend\templates\widget\name.phtml
but I can't override this phtml file . If any one knows, help me?
Vendor\magento\module-customer\view\frontend\templates\widget\name.phtml
override into my custom module
mycompany\custommodule\view\frontend\templates\widget\name.phtml
but I can't override this phtml file . If any one knows, help me?
Follow below steps to override vendor/magento/module-customer/view/frontend/templates/widget/name.phtml
file
app/code/Vendor/Module/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">
<type name="Magento\Customer\Block\Widget\Name">
<plugin name="custom_widget_name" type="Vendor\Module\Plugin\Customer\Block\Widget\Name" />
</type>
</config>
app/code/Vendor/Module/Plugin/Customer/Block/Widget/Name.php
<?php
namespace Vendor\Module\Plugin\Customer\Block\Widget;
class Name
{
public function after_construct(\Magento\Customer\Block\Widget\Name $result)
{
$result->setTemplate('Vendor_Module::widget/name.phtml');
return $result;
}
}
?>
Now copy vendor/magento/module-customer/view/frontend/templates/widget/name.phtml
and paste into app/code/Vendor/Module/view/frontend/templates/widget/name.phtml