How to add more information to Order Information page (Admin and Customer)How to extend backend template files in Magento 21.9.0.1 CE Programmatically Authorize, then CaptureProgramatically create order with Authorize.net payment method, already authorizedMagento 2 - Get order PayPal information programmaticallyHow to add an extension attribute into “Customer Address”Custom payment gateway order getPayment returns nullAdd additional information to payment methodForm is not displayed on panel admin Magento 2Magento offline custom Payment method with drop down listMagento 1.9 combining Billing & shipping information into one and shipping method & payment information into oneMagento 2 How to disable price from orders, customer account and order view if custom module is enabled?

Peter's Strange Word

How much stiffer are 23c tires over 28c?

Is having access to past exams cheating and, if yes, could it be proven just by a good grade?

Should I take out a loan for a friend to invest on my behalf?

Virginia employer terminated employee and wants signing bonus returned

Good allowance savings plan?

Force user to remove USB token

Do f-stop and exposure time perfectly cancel?

The bar has been raised

Does "variables should live in the smallest scope as possible" include the case "variables should not exist if possible"?

How does airport security verify that you can carry a battery bank over 100 Wh?

How did Alan Turing break the enigma code using the hint given by the lady in the bar?

Could a cubesat propel itself to Mars?

Are the terms "stab" and "staccato" synonyms?

Grey hair or white hair

Should I tell my boss the work he did was worthless

Do Bugbears' arms literally get longer when it's their turn?

Why does the negative sign arise in this thermodynamic relation?

Why don't MCU characters ever seem to have language issues?

How are such low op-amp input currents possible?

Why would a jet engine that runs at temps excess of 2000°C burn when it crashes?

Could a cubesat be propelled to the moon?

Why does Deadpool say "You're welcome, Canada," after shooting Ryan Reynolds in the end credits?

Solving "Resistance between two nodes on a grid" problem in Mathematica



How to add more information to Order Information page (Admin and Customer)


How to extend backend template files in Magento 21.9.0.1 CE Programmatically Authorize, then CaptureProgramatically create order with Authorize.net payment method, already authorizedMagento 2 - Get order PayPal information programmaticallyHow to add an extension attribute into “Customer Address”Custom payment gateway order getPayment returns nullAdd additional information to payment methodForm is not displayed on panel admin Magento 2Magento offline custom Payment method with drop down listMagento 1.9 combining Billing & shipping information into one and shipping method & payment information into oneMagento 2 How to disable price from orders, customer account and order view if custom module is enabled?













1















I'm super noob in Magento module development, but I'm working on a custom payment module that grabs some payment information on checkout into "additional_information", using this Observer:



class DataAssignObserver extends AbstractDataAssignObserver

/**
* @param Observer $observer
* @return void
*/
public function execute(Observer $observer)

$method = $this->readMethodArgument($observer);
$data = $this->readDataArgument($observer);

$additionalData = $data->getData(PaymentInterface::KEY_ADDITIONAL_DATA);
if (!is_array($additionalData))
return;


// $paymentModel = $this->readPaymentModelArgument($observer); // Magento 2.1 ONLY
$paymentInfo = $method->getInfoInstance();

// $paymentModel->setAdditionalInformation(
$paymentInfo->setAdditionalInformation(
$additionalData
);




Is there a detailed example on how to pull this information into the Order information pages, admin and customer side?



I know a few bits and pieces, like $paymentInfo->getAdditionalInformation(), but I'd really like to have a detailed example for it.










share|improve this question














bumped to the homepage by Community 10 hours ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.















  • do you want to show the additional information on order page(adminhtml)?

    – Bojjaiah
    Feb 21 '17 at 9:39












  • Yes, adminhtml and frontend

    – Marco Ferreira
    Feb 22 '17 at 19:06











  • which place do you want to show?

    – Bojjaiah
    Feb 23 '17 at 4:56











  • Well, ideally to the "Payment Information" on the adminhtml side and "Payment Method" on the frontend side. Basically the same way you get credit card information when you use credit card.

    – Marco Ferreira
    Feb 24 '17 at 5:14












  • see example magento.stackexchange.com/questions/76434/…

    – Bojjaiah
    Feb 24 '17 at 6:51















1















I'm super noob in Magento module development, but I'm working on a custom payment module that grabs some payment information on checkout into "additional_information", using this Observer:



class DataAssignObserver extends AbstractDataAssignObserver

/**
* @param Observer $observer
* @return void
*/
public function execute(Observer $observer)

$method = $this->readMethodArgument($observer);
$data = $this->readDataArgument($observer);

$additionalData = $data->getData(PaymentInterface::KEY_ADDITIONAL_DATA);
if (!is_array($additionalData))
return;


// $paymentModel = $this->readPaymentModelArgument($observer); // Magento 2.1 ONLY
$paymentInfo = $method->getInfoInstance();

// $paymentModel->setAdditionalInformation(
$paymentInfo->setAdditionalInformation(
$additionalData
);




Is there a detailed example on how to pull this information into the Order information pages, admin and customer side?



I know a few bits and pieces, like $paymentInfo->getAdditionalInformation(), but I'd really like to have a detailed example for it.










share|improve this question














bumped to the homepage by Community 10 hours ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.















  • do you want to show the additional information on order page(adminhtml)?

    – Bojjaiah
    Feb 21 '17 at 9:39












  • Yes, adminhtml and frontend

    – Marco Ferreira
    Feb 22 '17 at 19:06











  • which place do you want to show?

    – Bojjaiah
    Feb 23 '17 at 4:56











  • Well, ideally to the "Payment Information" on the adminhtml side and "Payment Method" on the frontend side. Basically the same way you get credit card information when you use credit card.

    – Marco Ferreira
    Feb 24 '17 at 5:14












  • see example magento.stackexchange.com/questions/76434/…

    – Bojjaiah
    Feb 24 '17 at 6:51













1












1








1








I'm super noob in Magento module development, but I'm working on a custom payment module that grabs some payment information on checkout into "additional_information", using this Observer:



class DataAssignObserver extends AbstractDataAssignObserver

/**
* @param Observer $observer
* @return void
*/
public function execute(Observer $observer)

$method = $this->readMethodArgument($observer);
$data = $this->readDataArgument($observer);

$additionalData = $data->getData(PaymentInterface::KEY_ADDITIONAL_DATA);
if (!is_array($additionalData))
return;


// $paymentModel = $this->readPaymentModelArgument($observer); // Magento 2.1 ONLY
$paymentInfo = $method->getInfoInstance();

// $paymentModel->setAdditionalInformation(
$paymentInfo->setAdditionalInformation(
$additionalData
);




Is there a detailed example on how to pull this information into the Order information pages, admin and customer side?



I know a few bits and pieces, like $paymentInfo->getAdditionalInformation(), but I'd really like to have a detailed example for it.










share|improve this question














I'm super noob in Magento module development, but I'm working on a custom payment module that grabs some payment information on checkout into "additional_information", using this Observer:



class DataAssignObserver extends AbstractDataAssignObserver

/**
* @param Observer $observer
* @return void
*/
public function execute(Observer $observer)

$method = $this->readMethodArgument($observer);
$data = $this->readDataArgument($observer);

$additionalData = $data->getData(PaymentInterface::KEY_ADDITIONAL_DATA);
if (!is_array($additionalData))
return;


// $paymentModel = $this->readPaymentModelArgument($observer); // Magento 2.1 ONLY
$paymentInfo = $method->getInfoInstance();

// $paymentModel->setAdditionalInformation(
$paymentInfo->setAdditionalInformation(
$additionalData
);




Is there a detailed example on how to pull this information into the Order information pages, admin and customer side?



I know a few bits and pieces, like $paymentInfo->getAdditionalInformation(), but I'd really like to have a detailed example for it.







magento-2.1 orders custom payment-methods payment






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Feb 20 '17 at 20:45









Marco FerreiraMarco Ferreira

62




62





bumped to the homepage by Community 10 hours ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







bumped to the homepage by Community 10 hours ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.














  • do you want to show the additional information on order page(adminhtml)?

    – Bojjaiah
    Feb 21 '17 at 9:39












  • Yes, adminhtml and frontend

    – Marco Ferreira
    Feb 22 '17 at 19:06











  • which place do you want to show?

    – Bojjaiah
    Feb 23 '17 at 4:56











  • Well, ideally to the "Payment Information" on the adminhtml side and "Payment Method" on the frontend side. Basically the same way you get credit card information when you use credit card.

    – Marco Ferreira
    Feb 24 '17 at 5:14












  • see example magento.stackexchange.com/questions/76434/…

    – Bojjaiah
    Feb 24 '17 at 6:51

















  • do you want to show the additional information on order page(adminhtml)?

    – Bojjaiah
    Feb 21 '17 at 9:39












  • Yes, adminhtml and frontend

    – Marco Ferreira
    Feb 22 '17 at 19:06











  • which place do you want to show?

    – Bojjaiah
    Feb 23 '17 at 4:56











  • Well, ideally to the "Payment Information" on the adminhtml side and "Payment Method" on the frontend side. Basically the same way you get credit card information when you use credit card.

    – Marco Ferreira
    Feb 24 '17 at 5:14












  • see example magento.stackexchange.com/questions/76434/…

    – Bojjaiah
    Feb 24 '17 at 6:51
















do you want to show the additional information on order page(adminhtml)?

– Bojjaiah
Feb 21 '17 at 9:39






do you want to show the additional information on order page(adminhtml)?

– Bojjaiah
Feb 21 '17 at 9:39














Yes, adminhtml and frontend

– Marco Ferreira
Feb 22 '17 at 19:06





Yes, adminhtml and frontend

– Marco Ferreira
Feb 22 '17 at 19:06













which place do you want to show?

– Bojjaiah
Feb 23 '17 at 4:56





which place do you want to show?

– Bojjaiah
Feb 23 '17 at 4:56













Well, ideally to the "Payment Information" on the adminhtml side and "Payment Method" on the frontend side. Basically the same way you get credit card information when you use credit card.

– Marco Ferreira
Feb 24 '17 at 5:14






Well, ideally to the "Payment Information" on the adminhtml side and "Payment Method" on the frontend side. Basically the same way you get credit card information when you use credit card.

– Marco Ferreira
Feb 24 '17 at 5:14














see example magento.stackexchange.com/questions/76434/…

– Bojjaiah
Feb 24 '17 at 6:51





see example magento.stackexchange.com/questions/76434/…

– Bojjaiah
Feb 24 '17 at 6:51










2 Answers
2






active

oldest

votes


















0














you can pull the information by extending Payment Method Block.



registration.php



<?php
MagentoFrameworkComponentComponentRegistrar::register(
MagentoFrameworkComponentComponentRegistrar::MODULE,
'[VendorName]_[ModuleName]',
__DIR__
);


Info.php



<?php

namespace [VendorName][ModuleName]BlockAdminhtmlOrderViewTab;

class Info extends MagentoSalesBlockAdminhtmlOrderViewTabInfo






etc/adminhtml/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="MagentoSalesBlockAdminhtmlOrderViewTabInfo" type="[VendorName][ModuleName]BlockAdminhtmlOrderViewTabInfo" />
</config>


view/adminhtml/layout/sales_order_view.xml



<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="order_tab_info">
<action method="setTemplate">
<argument name="template" translate="true" xsi:type="string">order/view/tab/Info.phtml</argument>
</action>
</referenceBlock>
</body>
</page>


view/adminhtml/templates/order/view/tab/Info.phtml



 <?php
/**
* Copyright © 2016 Magento. All rights reserved.
* See COPYING.txt for license details.
*/

// @codingStandardsIgnoreFile

?>
<?php /** @var $block MagentoSalesBlockAdminhtmlOrderViewTabInfo */ ?>
<?php $_order = $block->getOrder() ?>

<div id="order-messages">
<?php echo $block->getChildHtml('order_messages') ?>
</div>

<?php echo $block->getChildHtml('order_info') ?>
<input type="hidden" name="order_id" value="<?php /* @escapeNotVerified */ echo $_order->getId() ?>"/>

<section class="admin__page-section order-view-billing-shipping">
<div class="admin__page-section-title">
<span class="title"><?php /* @escapeNotVerified */ echo __('Payment &amp; Shipping Method') ?></span>
</div>
<!-- this is Sample Text -->
<h1>Magento 2 Custom Payment Text</h1>
<div class="admin__page-section-content">
<div class="admin__page-section-item order-payment-method<?php if ($_order->getIsVirtual()): ?> order-payment-method-virtual<?php endif; ?>">
<?php /* Payment Method */ ?>
<div class="admin__page-section-item-title">
<span class="title"><?php /* @escapeNotVerified */ echo __('Payment Information') ?></span>
</div>
<div class="admin__page-section-item-content">
<div class="order-payment-method-title"><?php echo $block->getPaymentHtml() ?></div>
<div class="order-payment-currency"><?php /* @escapeNotVerified */ echo __('The order was placed using %1.', $_order->getOrderCurrencyCode()) ?></div>
<div class="order-payment-additional">
<?php echo $block->getChildHtml('order_payment_additional'); ?>
<?php echo $block->getChildHtml('payment_additional_info'); ?>
</div>
</div>
</div>
<?php echo $block->getChildHtml('order_shipping_view') ?>
</div>
</section>

<?php echo $block->getGiftOptionsHtml() ?>

<section class="admin__page-section">
<div class="admin__page-section-title">
<span class="title"><?php /* @escapeNotVerified */ echo __('Items Ordered') ?></span>
</div>
<?php echo $block->getItemsHtml() ?>
</section>

<section class="admin__page-section">
<div class="admin__page-section-title">
<span class="title"><?php /* @escapeNotVerified */ echo __('Order Total') ?></span>
</div>
<div class="admin__page-section-content">
<div class="admin__page-section-item order-comments-history">
<div class="admin__page-section-item-title">
<span class="title"><?php /* @escapeNotVerified */ echo __('Notes for this Order') ?></span>
</div>
<?php echo $block->getChildHtml('order_history') ?>
</div>

<div class="admin__page-section-item order-totals">
<div class="admin__page-section-item-title">
<span class="title"><?php /* @escapeNotVerified */ echo __('Order Totals') ?></span>
</div>
<?php echo $block->getChildHtml('order_totals') ?>
</div>
</div>
</section>

<?php echo $block->getChildHtml('popup_window');?>

<script>
require([
"prototype",
"Magento_Sales/order/giftoptions_tooltip"
], function()

//<![CDATA[
/**
* Retrieve gift options tooltip content
*/
function getGiftOptionsTooltipContent(itemId)
var contentLines = [];
var headerLine = null;
var contentLine = null;

$$('#gift_options_data_' + itemId + ' .gift-options-tooltip-content').each(function (element)
if (element.down(0))
headerLine = element.down(0).innerHTML;
contentLine = element.down(0).next().innerHTML;
if (contentLine.length > 30)
contentLine = contentLine.slice(0,30) + '...';

contentLines.push(headerLine + ' ' + contentLine);

);
return contentLines.join('<br/>');

giftOptionsTooltip.setTooltipContentLoaderFunction(getGiftOptionsTooltipContent);
window.getGiftOptionsTooltipContent = getGiftOptionsTooltipContent;
//]]>

);
</script>


By this way you can override the Payment Section.






share|improve this answer























  • Thank you. I'll try this out tonight and give some feedback.

    – Marco Ferreira
    Feb 28 '17 at 20:35











  • Sorry, but only now I could get back to this. Three issues I'm having: 1. After following the sample code/files you posted I got the excepption ReflectionException: Class [...]BlockAdminhtmlOrderViewTabInfo does not exist. 2. Removing <preference for="MagentoSalesBlockAdminhtmlOrderViewTabInfo" type="[...]BlockAdminhtmlOrderViewTabInfo" /> from etc/adminhtml/di.xml fixed the exception, but the order info page is empty. 3. Finally, in Info.php, I already have a namespace defined as namespace [VendorName][ModuleName]Block;. How would I go about these?

    – Marco Ferreira
    May 7 '17 at 14:59


















0














Add vendor_name in view/adminhtml/layout/sales_order_view.xml



vendor_name::order/view/tab/Info.phtml



This solve the blank page in order info.






share|improve this answer






















    Your Answer








    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "479"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f160871%2fhow-to-add-more-information-to-order-information-page-admin-and-customer%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    you can pull the information by extending Payment Method Block.



    registration.php



    <?php
    MagentoFrameworkComponentComponentRegistrar::register(
    MagentoFrameworkComponentComponentRegistrar::MODULE,
    '[VendorName]_[ModuleName]',
    __DIR__
    );


    Info.php



    <?php

    namespace [VendorName][ModuleName]BlockAdminhtmlOrderViewTab;

    class Info extends MagentoSalesBlockAdminhtmlOrderViewTabInfo






    etc/adminhtml/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="MagentoSalesBlockAdminhtmlOrderViewTabInfo" type="[VendorName][ModuleName]BlockAdminhtmlOrderViewTabInfo" />
    </config>


    view/adminhtml/layout/sales_order_view.xml



    <?xml version="1.0"?>
    <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd">
    <body>
    <referenceBlock name="order_tab_info">
    <action method="setTemplate">
    <argument name="template" translate="true" xsi:type="string">order/view/tab/Info.phtml</argument>
    </action>
    </referenceBlock>
    </body>
    </page>


    view/adminhtml/templates/order/view/tab/Info.phtml



     <?php
    /**
    * Copyright © 2016 Magento. All rights reserved.
    * See COPYING.txt for license details.
    */

    // @codingStandardsIgnoreFile

    ?>
    <?php /** @var $block MagentoSalesBlockAdminhtmlOrderViewTabInfo */ ?>
    <?php $_order = $block->getOrder() ?>

    <div id="order-messages">
    <?php echo $block->getChildHtml('order_messages') ?>
    </div>

    <?php echo $block->getChildHtml('order_info') ?>
    <input type="hidden" name="order_id" value="<?php /* @escapeNotVerified */ echo $_order->getId() ?>"/>

    <section class="admin__page-section order-view-billing-shipping">
    <div class="admin__page-section-title">
    <span class="title"><?php /* @escapeNotVerified */ echo __('Payment &amp; Shipping Method') ?></span>
    </div>
    <!-- this is Sample Text -->
    <h1>Magento 2 Custom Payment Text</h1>
    <div class="admin__page-section-content">
    <div class="admin__page-section-item order-payment-method<?php if ($_order->getIsVirtual()): ?> order-payment-method-virtual<?php endif; ?>">
    <?php /* Payment Method */ ?>
    <div class="admin__page-section-item-title">
    <span class="title"><?php /* @escapeNotVerified */ echo __('Payment Information') ?></span>
    </div>
    <div class="admin__page-section-item-content">
    <div class="order-payment-method-title"><?php echo $block->getPaymentHtml() ?></div>
    <div class="order-payment-currency"><?php /* @escapeNotVerified */ echo __('The order was placed using %1.', $_order->getOrderCurrencyCode()) ?></div>
    <div class="order-payment-additional">
    <?php echo $block->getChildHtml('order_payment_additional'); ?>
    <?php echo $block->getChildHtml('payment_additional_info'); ?>
    </div>
    </div>
    </div>
    <?php echo $block->getChildHtml('order_shipping_view') ?>
    </div>
    </section>

    <?php echo $block->getGiftOptionsHtml() ?>

    <section class="admin__page-section">
    <div class="admin__page-section-title">
    <span class="title"><?php /* @escapeNotVerified */ echo __('Items Ordered') ?></span>
    </div>
    <?php echo $block->getItemsHtml() ?>
    </section>

    <section class="admin__page-section">
    <div class="admin__page-section-title">
    <span class="title"><?php /* @escapeNotVerified */ echo __('Order Total') ?></span>
    </div>
    <div class="admin__page-section-content">
    <div class="admin__page-section-item order-comments-history">
    <div class="admin__page-section-item-title">
    <span class="title"><?php /* @escapeNotVerified */ echo __('Notes for this Order') ?></span>
    </div>
    <?php echo $block->getChildHtml('order_history') ?>
    </div>

    <div class="admin__page-section-item order-totals">
    <div class="admin__page-section-item-title">
    <span class="title"><?php /* @escapeNotVerified */ echo __('Order Totals') ?></span>
    </div>
    <?php echo $block->getChildHtml('order_totals') ?>
    </div>
    </div>
    </section>

    <?php echo $block->getChildHtml('popup_window');?>

    <script>
    require([
    "prototype",
    "Magento_Sales/order/giftoptions_tooltip"
    ], function()

    //<![CDATA[
    /**
    * Retrieve gift options tooltip content
    */
    function getGiftOptionsTooltipContent(itemId)
    var contentLines = [];
    var headerLine = null;
    var contentLine = null;

    $$('#gift_options_data_' + itemId + ' .gift-options-tooltip-content').each(function (element)
    if (element.down(0))
    headerLine = element.down(0).innerHTML;
    contentLine = element.down(0).next().innerHTML;
    if (contentLine.length > 30)
    contentLine = contentLine.slice(0,30) + '...';

    contentLines.push(headerLine + ' ' + contentLine);

    );
    return contentLines.join('<br/>');

    giftOptionsTooltip.setTooltipContentLoaderFunction(getGiftOptionsTooltipContent);
    window.getGiftOptionsTooltipContent = getGiftOptionsTooltipContent;
    //]]>

    );
    </script>


    By this way you can override the Payment Section.






    share|improve this answer























    • Thank you. I'll try this out tonight and give some feedback.

      – Marco Ferreira
      Feb 28 '17 at 20:35











    • Sorry, but only now I could get back to this. Three issues I'm having: 1. After following the sample code/files you posted I got the excepption ReflectionException: Class [...]BlockAdminhtmlOrderViewTabInfo does not exist. 2. Removing <preference for="MagentoSalesBlockAdminhtmlOrderViewTabInfo" type="[...]BlockAdminhtmlOrderViewTabInfo" /> from etc/adminhtml/di.xml fixed the exception, but the order info page is empty. 3. Finally, in Info.php, I already have a namespace defined as namespace [VendorName][ModuleName]Block;. How would I go about these?

      – Marco Ferreira
      May 7 '17 at 14:59















    0














    you can pull the information by extending Payment Method Block.



    registration.php



    <?php
    MagentoFrameworkComponentComponentRegistrar::register(
    MagentoFrameworkComponentComponentRegistrar::MODULE,
    '[VendorName]_[ModuleName]',
    __DIR__
    );


    Info.php



    <?php

    namespace [VendorName][ModuleName]BlockAdminhtmlOrderViewTab;

    class Info extends MagentoSalesBlockAdminhtmlOrderViewTabInfo






    etc/adminhtml/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="MagentoSalesBlockAdminhtmlOrderViewTabInfo" type="[VendorName][ModuleName]BlockAdminhtmlOrderViewTabInfo" />
    </config>


    view/adminhtml/layout/sales_order_view.xml



    <?xml version="1.0"?>
    <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd">
    <body>
    <referenceBlock name="order_tab_info">
    <action method="setTemplate">
    <argument name="template" translate="true" xsi:type="string">order/view/tab/Info.phtml</argument>
    </action>
    </referenceBlock>
    </body>
    </page>


    view/adminhtml/templates/order/view/tab/Info.phtml



     <?php
    /**
    * Copyright © 2016 Magento. All rights reserved.
    * See COPYING.txt for license details.
    */

    // @codingStandardsIgnoreFile

    ?>
    <?php /** @var $block MagentoSalesBlockAdminhtmlOrderViewTabInfo */ ?>
    <?php $_order = $block->getOrder() ?>

    <div id="order-messages">
    <?php echo $block->getChildHtml('order_messages') ?>
    </div>

    <?php echo $block->getChildHtml('order_info') ?>
    <input type="hidden" name="order_id" value="<?php /* @escapeNotVerified */ echo $_order->getId() ?>"/>

    <section class="admin__page-section order-view-billing-shipping">
    <div class="admin__page-section-title">
    <span class="title"><?php /* @escapeNotVerified */ echo __('Payment &amp; Shipping Method') ?></span>
    </div>
    <!-- this is Sample Text -->
    <h1>Magento 2 Custom Payment Text</h1>
    <div class="admin__page-section-content">
    <div class="admin__page-section-item order-payment-method<?php if ($_order->getIsVirtual()): ?> order-payment-method-virtual<?php endif; ?>">
    <?php /* Payment Method */ ?>
    <div class="admin__page-section-item-title">
    <span class="title"><?php /* @escapeNotVerified */ echo __('Payment Information') ?></span>
    </div>
    <div class="admin__page-section-item-content">
    <div class="order-payment-method-title"><?php echo $block->getPaymentHtml() ?></div>
    <div class="order-payment-currency"><?php /* @escapeNotVerified */ echo __('The order was placed using %1.', $_order->getOrderCurrencyCode()) ?></div>
    <div class="order-payment-additional">
    <?php echo $block->getChildHtml('order_payment_additional'); ?>
    <?php echo $block->getChildHtml('payment_additional_info'); ?>
    </div>
    </div>
    </div>
    <?php echo $block->getChildHtml('order_shipping_view') ?>
    </div>
    </section>

    <?php echo $block->getGiftOptionsHtml() ?>

    <section class="admin__page-section">
    <div class="admin__page-section-title">
    <span class="title"><?php /* @escapeNotVerified */ echo __('Items Ordered') ?></span>
    </div>
    <?php echo $block->getItemsHtml() ?>
    </section>

    <section class="admin__page-section">
    <div class="admin__page-section-title">
    <span class="title"><?php /* @escapeNotVerified */ echo __('Order Total') ?></span>
    </div>
    <div class="admin__page-section-content">
    <div class="admin__page-section-item order-comments-history">
    <div class="admin__page-section-item-title">
    <span class="title"><?php /* @escapeNotVerified */ echo __('Notes for this Order') ?></span>
    </div>
    <?php echo $block->getChildHtml('order_history') ?>
    </div>

    <div class="admin__page-section-item order-totals">
    <div class="admin__page-section-item-title">
    <span class="title"><?php /* @escapeNotVerified */ echo __('Order Totals') ?></span>
    </div>
    <?php echo $block->getChildHtml('order_totals') ?>
    </div>
    </div>
    </section>

    <?php echo $block->getChildHtml('popup_window');?>

    <script>
    require([
    "prototype",
    "Magento_Sales/order/giftoptions_tooltip"
    ], function()

    //<![CDATA[
    /**
    * Retrieve gift options tooltip content
    */
    function getGiftOptionsTooltipContent(itemId)
    var contentLines = [];
    var headerLine = null;
    var contentLine = null;

    $$('#gift_options_data_' + itemId + ' .gift-options-tooltip-content').each(function (element)
    if (element.down(0))
    headerLine = element.down(0).innerHTML;
    contentLine = element.down(0).next().innerHTML;
    if (contentLine.length > 30)
    contentLine = contentLine.slice(0,30) + '...';

    contentLines.push(headerLine + ' ' + contentLine);

    );
    return contentLines.join('<br/>');

    giftOptionsTooltip.setTooltipContentLoaderFunction(getGiftOptionsTooltipContent);
    window.getGiftOptionsTooltipContent = getGiftOptionsTooltipContent;
    //]]>

    );
    </script>


    By this way you can override the Payment Section.






    share|improve this answer























    • Thank you. I'll try this out tonight and give some feedback.

      – Marco Ferreira
      Feb 28 '17 at 20:35











    • Sorry, but only now I could get back to this. Three issues I'm having: 1. After following the sample code/files you posted I got the excepption ReflectionException: Class [...]BlockAdminhtmlOrderViewTabInfo does not exist. 2. Removing <preference for="MagentoSalesBlockAdminhtmlOrderViewTabInfo" type="[...]BlockAdminhtmlOrderViewTabInfo" /> from etc/adminhtml/di.xml fixed the exception, but the order info page is empty. 3. Finally, in Info.php, I already have a namespace defined as namespace [VendorName][ModuleName]Block;. How would I go about these?

      – Marco Ferreira
      May 7 '17 at 14:59













    0












    0








    0







    you can pull the information by extending Payment Method Block.



    registration.php



    <?php
    MagentoFrameworkComponentComponentRegistrar::register(
    MagentoFrameworkComponentComponentRegistrar::MODULE,
    '[VendorName]_[ModuleName]',
    __DIR__
    );


    Info.php



    <?php

    namespace [VendorName][ModuleName]BlockAdminhtmlOrderViewTab;

    class Info extends MagentoSalesBlockAdminhtmlOrderViewTabInfo






    etc/adminhtml/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="MagentoSalesBlockAdminhtmlOrderViewTabInfo" type="[VendorName][ModuleName]BlockAdminhtmlOrderViewTabInfo" />
    </config>


    view/adminhtml/layout/sales_order_view.xml



    <?xml version="1.0"?>
    <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd">
    <body>
    <referenceBlock name="order_tab_info">
    <action method="setTemplate">
    <argument name="template" translate="true" xsi:type="string">order/view/tab/Info.phtml</argument>
    </action>
    </referenceBlock>
    </body>
    </page>


    view/adminhtml/templates/order/view/tab/Info.phtml



     <?php
    /**
    * Copyright © 2016 Magento. All rights reserved.
    * See COPYING.txt for license details.
    */

    // @codingStandardsIgnoreFile

    ?>
    <?php /** @var $block MagentoSalesBlockAdminhtmlOrderViewTabInfo */ ?>
    <?php $_order = $block->getOrder() ?>

    <div id="order-messages">
    <?php echo $block->getChildHtml('order_messages') ?>
    </div>

    <?php echo $block->getChildHtml('order_info') ?>
    <input type="hidden" name="order_id" value="<?php /* @escapeNotVerified */ echo $_order->getId() ?>"/>

    <section class="admin__page-section order-view-billing-shipping">
    <div class="admin__page-section-title">
    <span class="title"><?php /* @escapeNotVerified */ echo __('Payment &amp; Shipping Method') ?></span>
    </div>
    <!-- this is Sample Text -->
    <h1>Magento 2 Custom Payment Text</h1>
    <div class="admin__page-section-content">
    <div class="admin__page-section-item order-payment-method<?php if ($_order->getIsVirtual()): ?> order-payment-method-virtual<?php endif; ?>">
    <?php /* Payment Method */ ?>
    <div class="admin__page-section-item-title">
    <span class="title"><?php /* @escapeNotVerified */ echo __('Payment Information') ?></span>
    </div>
    <div class="admin__page-section-item-content">
    <div class="order-payment-method-title"><?php echo $block->getPaymentHtml() ?></div>
    <div class="order-payment-currency"><?php /* @escapeNotVerified */ echo __('The order was placed using %1.', $_order->getOrderCurrencyCode()) ?></div>
    <div class="order-payment-additional">
    <?php echo $block->getChildHtml('order_payment_additional'); ?>
    <?php echo $block->getChildHtml('payment_additional_info'); ?>
    </div>
    </div>
    </div>
    <?php echo $block->getChildHtml('order_shipping_view') ?>
    </div>
    </section>

    <?php echo $block->getGiftOptionsHtml() ?>

    <section class="admin__page-section">
    <div class="admin__page-section-title">
    <span class="title"><?php /* @escapeNotVerified */ echo __('Items Ordered') ?></span>
    </div>
    <?php echo $block->getItemsHtml() ?>
    </section>

    <section class="admin__page-section">
    <div class="admin__page-section-title">
    <span class="title"><?php /* @escapeNotVerified */ echo __('Order Total') ?></span>
    </div>
    <div class="admin__page-section-content">
    <div class="admin__page-section-item order-comments-history">
    <div class="admin__page-section-item-title">
    <span class="title"><?php /* @escapeNotVerified */ echo __('Notes for this Order') ?></span>
    </div>
    <?php echo $block->getChildHtml('order_history') ?>
    </div>

    <div class="admin__page-section-item order-totals">
    <div class="admin__page-section-item-title">
    <span class="title"><?php /* @escapeNotVerified */ echo __('Order Totals') ?></span>
    </div>
    <?php echo $block->getChildHtml('order_totals') ?>
    </div>
    </div>
    </section>

    <?php echo $block->getChildHtml('popup_window');?>

    <script>
    require([
    "prototype",
    "Magento_Sales/order/giftoptions_tooltip"
    ], function()

    //<![CDATA[
    /**
    * Retrieve gift options tooltip content
    */
    function getGiftOptionsTooltipContent(itemId)
    var contentLines = [];
    var headerLine = null;
    var contentLine = null;

    $$('#gift_options_data_' + itemId + ' .gift-options-tooltip-content').each(function (element)
    if (element.down(0))
    headerLine = element.down(0).innerHTML;
    contentLine = element.down(0).next().innerHTML;
    if (contentLine.length > 30)
    contentLine = contentLine.slice(0,30) + '...';

    contentLines.push(headerLine + ' ' + contentLine);

    );
    return contentLines.join('<br/>');

    giftOptionsTooltip.setTooltipContentLoaderFunction(getGiftOptionsTooltipContent);
    window.getGiftOptionsTooltipContent = getGiftOptionsTooltipContent;
    //]]>

    );
    </script>


    By this way you can override the Payment Section.






    share|improve this answer













    you can pull the information by extending Payment Method Block.



    registration.php



    <?php
    MagentoFrameworkComponentComponentRegistrar::register(
    MagentoFrameworkComponentComponentRegistrar::MODULE,
    '[VendorName]_[ModuleName]',
    __DIR__
    );


    Info.php



    <?php

    namespace [VendorName][ModuleName]BlockAdminhtmlOrderViewTab;

    class Info extends MagentoSalesBlockAdminhtmlOrderViewTabInfo






    etc/adminhtml/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="MagentoSalesBlockAdminhtmlOrderViewTabInfo" type="[VendorName][ModuleName]BlockAdminhtmlOrderViewTabInfo" />
    </config>


    view/adminhtml/layout/sales_order_view.xml



    <?xml version="1.0"?>
    <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd">
    <body>
    <referenceBlock name="order_tab_info">
    <action method="setTemplate">
    <argument name="template" translate="true" xsi:type="string">order/view/tab/Info.phtml</argument>
    </action>
    </referenceBlock>
    </body>
    </page>


    view/adminhtml/templates/order/view/tab/Info.phtml



     <?php
    /**
    * Copyright © 2016 Magento. All rights reserved.
    * See COPYING.txt for license details.
    */

    // @codingStandardsIgnoreFile

    ?>
    <?php /** @var $block MagentoSalesBlockAdminhtmlOrderViewTabInfo */ ?>
    <?php $_order = $block->getOrder() ?>

    <div id="order-messages">
    <?php echo $block->getChildHtml('order_messages') ?>
    </div>

    <?php echo $block->getChildHtml('order_info') ?>
    <input type="hidden" name="order_id" value="<?php /* @escapeNotVerified */ echo $_order->getId() ?>"/>

    <section class="admin__page-section order-view-billing-shipping">
    <div class="admin__page-section-title">
    <span class="title"><?php /* @escapeNotVerified */ echo __('Payment &amp; Shipping Method') ?></span>
    </div>
    <!-- this is Sample Text -->
    <h1>Magento 2 Custom Payment Text</h1>
    <div class="admin__page-section-content">
    <div class="admin__page-section-item order-payment-method<?php if ($_order->getIsVirtual()): ?> order-payment-method-virtual<?php endif; ?>">
    <?php /* Payment Method */ ?>
    <div class="admin__page-section-item-title">
    <span class="title"><?php /* @escapeNotVerified */ echo __('Payment Information') ?></span>
    </div>
    <div class="admin__page-section-item-content">
    <div class="order-payment-method-title"><?php echo $block->getPaymentHtml() ?></div>
    <div class="order-payment-currency"><?php /* @escapeNotVerified */ echo __('The order was placed using %1.', $_order->getOrderCurrencyCode()) ?></div>
    <div class="order-payment-additional">
    <?php echo $block->getChildHtml('order_payment_additional'); ?>
    <?php echo $block->getChildHtml('payment_additional_info'); ?>
    </div>
    </div>
    </div>
    <?php echo $block->getChildHtml('order_shipping_view') ?>
    </div>
    </section>

    <?php echo $block->getGiftOptionsHtml() ?>

    <section class="admin__page-section">
    <div class="admin__page-section-title">
    <span class="title"><?php /* @escapeNotVerified */ echo __('Items Ordered') ?></span>
    </div>
    <?php echo $block->getItemsHtml() ?>
    </section>

    <section class="admin__page-section">
    <div class="admin__page-section-title">
    <span class="title"><?php /* @escapeNotVerified */ echo __('Order Total') ?></span>
    </div>
    <div class="admin__page-section-content">
    <div class="admin__page-section-item order-comments-history">
    <div class="admin__page-section-item-title">
    <span class="title"><?php /* @escapeNotVerified */ echo __('Notes for this Order') ?></span>
    </div>
    <?php echo $block->getChildHtml('order_history') ?>
    </div>

    <div class="admin__page-section-item order-totals">
    <div class="admin__page-section-item-title">
    <span class="title"><?php /* @escapeNotVerified */ echo __('Order Totals') ?></span>
    </div>
    <?php echo $block->getChildHtml('order_totals') ?>
    </div>
    </div>
    </section>

    <?php echo $block->getChildHtml('popup_window');?>

    <script>
    require([
    "prototype",
    "Magento_Sales/order/giftoptions_tooltip"
    ], function()

    //<![CDATA[
    /**
    * Retrieve gift options tooltip content
    */
    function getGiftOptionsTooltipContent(itemId)
    var contentLines = [];
    var headerLine = null;
    var contentLine = null;

    $$('#gift_options_data_' + itemId + ' .gift-options-tooltip-content').each(function (element)
    if (element.down(0))
    headerLine = element.down(0).innerHTML;
    contentLine = element.down(0).next().innerHTML;
    if (contentLine.length > 30)
    contentLine = contentLine.slice(0,30) + '...';

    contentLines.push(headerLine + ' ' + contentLine);

    );
    return contentLines.join('<br/>');

    giftOptionsTooltip.setTooltipContentLoaderFunction(getGiftOptionsTooltipContent);
    window.getGiftOptionsTooltipContent = getGiftOptionsTooltipContent;
    //]]>

    );
    </script>


    By this way you can override the Payment Section.







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Feb 24 '17 at 7:11









    BojjaiahBojjaiah

    2,5002572




    2,5002572












    • Thank you. I'll try this out tonight and give some feedback.

      – Marco Ferreira
      Feb 28 '17 at 20:35











    • Sorry, but only now I could get back to this. Three issues I'm having: 1. After following the sample code/files you posted I got the excepption ReflectionException: Class [...]BlockAdminhtmlOrderViewTabInfo does not exist. 2. Removing <preference for="MagentoSalesBlockAdminhtmlOrderViewTabInfo" type="[...]BlockAdminhtmlOrderViewTabInfo" /> from etc/adminhtml/di.xml fixed the exception, but the order info page is empty. 3. Finally, in Info.php, I already have a namespace defined as namespace [VendorName][ModuleName]Block;. How would I go about these?

      – Marco Ferreira
      May 7 '17 at 14:59

















    • Thank you. I'll try this out tonight and give some feedback.

      – Marco Ferreira
      Feb 28 '17 at 20:35











    • Sorry, but only now I could get back to this. Three issues I'm having: 1. After following the sample code/files you posted I got the excepption ReflectionException: Class [...]BlockAdminhtmlOrderViewTabInfo does not exist. 2. Removing <preference for="MagentoSalesBlockAdminhtmlOrderViewTabInfo" type="[...]BlockAdminhtmlOrderViewTabInfo" /> from etc/adminhtml/di.xml fixed the exception, but the order info page is empty. 3. Finally, in Info.php, I already have a namespace defined as namespace [VendorName][ModuleName]Block;. How would I go about these?

      – Marco Ferreira
      May 7 '17 at 14:59
















    Thank you. I'll try this out tonight and give some feedback.

    – Marco Ferreira
    Feb 28 '17 at 20:35





    Thank you. I'll try this out tonight and give some feedback.

    – Marco Ferreira
    Feb 28 '17 at 20:35













    Sorry, but only now I could get back to this. Three issues I'm having: 1. After following the sample code/files you posted I got the excepption ReflectionException: Class [...]BlockAdminhtmlOrderViewTabInfo does not exist. 2. Removing <preference for="MagentoSalesBlockAdminhtmlOrderViewTabInfo" type="[...]BlockAdminhtmlOrderViewTabInfo" /> from etc/adminhtml/di.xml fixed the exception, but the order info page is empty. 3. Finally, in Info.php, I already have a namespace defined as namespace [VendorName][ModuleName]Block;. How would I go about these?

    – Marco Ferreira
    May 7 '17 at 14:59





    Sorry, but only now I could get back to this. Three issues I'm having: 1. After following the sample code/files you posted I got the excepption ReflectionException: Class [...]BlockAdminhtmlOrderViewTabInfo does not exist. 2. Removing <preference for="MagentoSalesBlockAdminhtmlOrderViewTabInfo" type="[...]BlockAdminhtmlOrderViewTabInfo" /> from etc/adminhtml/di.xml fixed the exception, but the order info page is empty. 3. Finally, in Info.php, I already have a namespace defined as namespace [VendorName][ModuleName]Block;. How would I go about these?

    – Marco Ferreira
    May 7 '17 at 14:59













    0














    Add vendor_name in view/adminhtml/layout/sales_order_view.xml



    vendor_name::order/view/tab/Info.phtml



    This solve the blank page in order info.






    share|improve this answer



























      0














      Add vendor_name in view/adminhtml/layout/sales_order_view.xml



      vendor_name::order/view/tab/Info.phtml



      This solve the blank page in order info.






      share|improve this answer

























        0












        0








        0







        Add vendor_name in view/adminhtml/layout/sales_order_view.xml



        vendor_name::order/view/tab/Info.phtml



        This solve the blank page in order info.






        share|improve this answer













        Add vendor_name in view/adminhtml/layout/sales_order_view.xml



        vendor_name::order/view/tab/Info.phtml



        This solve the blank page in order info.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Feb 8 at 5:24









        Dharmender SainiDharmender Saini

        1




        1



























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Magento Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f160871%2fhow-to-add-more-information-to-order-information-page-admin-and-customer%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Magento 2 duplicate PHPSESSID cookie when using session_start() in custom php scriptMagento 2: User cant logged in into to account page, no error showing!Magento duplicate on subdomainGrabbing storeview from cookie (after using language selector)How do I run php custom script on magento2Magento 2: Include PHP script in headerSession lock after using Cm_RedisSessionscript php to update stockMagento set cookie popupMagento 2 session id cookie - where to find it?How to import Configurable product from csv with custom attributes using php scriptMagento 2 run custom PHP script

            Can not update quote_id field of “quote_item” table magento 2Magento 2.1 - We can't remove the item. (Shopping Cart doesnt allow us to remove items before becomes empty)Add value for custom quote item attribute using REST apiREST API endpoint v1/carts/cartId/items always returns error messageCorrect way to save entries to databaseHow to remove all associated quote objects of a customer completelyMagento 2 - Save value from custom input field to quote_itemGet quote_item data using quote id and product id filter in Magento 2How to set additional data to quote_item table from controller in Magento 2?What is the purpose of additional_data column in quote_item table in magento2Set Custom Price to Quote item magento2 from controller

            How to solve knockout JS error in Magento 2 Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?(Magento2) knockout.js:3012 Uncaught ReferenceError: Unable to process bindingUnable to process binding Knockout.js magento 2Cannot read property `scopeLabel` of undefined on Product Detail PageCan't get Customer Data on frontend in Magento 2Magento2 Order Summary - unable to process bindingKO templates are not loading in Magento 2.1 applicationgetting knockout js error magento 2Product grid not load -— Unable to process binding Knockout.js magento 2Product form not loaded in magento2Uncaught ReferenceError: Unable to process binding “if: function()return (isShowLegend()) ” magento 2