Magento 2 : Not able to override Magento_Payment::info/default.phtml
-
15-04-2021 - |
문제
I have tried to override this template file by overriding the whole block where its called i.e Magento\Payment\Block\Info
But i am not able to override this file Magento_Payment::info/default.phtml
Is their any way we can override this file ?
올바른 솔루션이 없습니다
다른 팁
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\Payment\Block\Info">
<plugin name="module_paympent_view_override_template" type="Vendor\Module\Plugin\Payment\Block\Info" />
</type>
</config>
Info.php
<?php
namespace Vendor\Module\Plugin\Payment\Block;
class Info
{
public function beforeToHtml(\Magento\Payment\Block\Info $subject)
{
$subject->setTemplate('Vendor_Module::info/default.phtml');
}
}
제휴하지 않습니다 magento.stackexchange