2

I made a custom online payment method. All things are going proper, but in order view page in Admin I am Not getting Payment Method Title. We already set the configuration for title and its same like another payment method also in DB we are getting the payment method code in sales_order_payment table. Also getting payment method in order grid but not in Order View. Please give me some suggestion on this.

2
  • How about your current issue? Sep 12 '16 at 2:28
  • Have you got any solution for this? Aug 31 '20 at 4:57
0

in [vendor]/[module]/etc/adminhtml/system.xml make sure you have something like this (label element)

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Magento/Config/etc/system_file.xsd">
    <system>
        <section id="payment">
            <group id="my_custompayment" translate="label" type="text" sortOrder="40" showInDefault="1" showInWebsite="1" showInStore="1">
                <label>Title for my custom payment</label>
                <comment>
                    <!-- comment -->
                </comment>
                <!-- fields -->
                <field id="active" translate="label" type="select" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="0">
                    <label>Enabled</label>
                    <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
                </field>
1
  • This relates to the configuration page, not the order view page. The question was asking where the text for the order view page is specified.
    – DanJAB
    Oct 29 '16 at 13:05
0

Simple way to get Payment title any where:

<?php 
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$order = $objectManager->get('Magento\Sales\Model\Order')->loadByIncrementId($block->getOrderId());
echo $payment = $order->getPayment()->getMethodInstance()->getTitle();
?>

:)

1

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.