As I don't have implemented admin theme I have to override /vendor/magento/module-payment/view/adminhtml/templates/info/default.phtml file in my custom module. how can I write my layout file to call this file?

I have copied default.phtml in my custom module


You can override the payment info model. The example below is for overriding \Magento\Paypal\Block\Payment\Info which is used for PayPal. You first need to check which payment method you are applying for and then override it. See where the template is set in the parent class in: \Magento\Payment\Block\Info::$_template


    namespace YourNamespace\YourModule\Block\Payment;

    class Info extends \Magento\Paypal\Block\Payment\Info
         * @var string
        protected $_template = 'YourNamespace_YourModule::info/default.phtml';


Be sure to update the di.xml as well.

  • basically i am need to get payment title on admin order detail page which i already done in vendor theme to check ... but as u know we have to overide it in child theme so i guess the method u mentioned will not work – Mustafa Ali May 18 '20 at 4:58
  • My solution doesn't require an overriding theme. It's overriding in a custom module. Which payment are you referring to? – Toan Tam May 18 '20 at 5:09
  • i made a custom payment method and i am getting its title from custom column on order detail page – Mustafa Ali May 18 '20 at 5:12
  • on sales order detail page in admin, I want to show payment title of order form database – Mustafa Ali May 18 '20 at 5:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.