PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Tuesday, August 23, 2022

[FIXED] How to show custom checkout filed in admin panel

 August 23, 2022     magento, magento2, module     No comments   

Issue

how to display custom filed in the admin panel.

table sales_order,quote cullom name gst

I want to display a field in the sale order. code details click here

enter image description here


Solution

You can override the adminhtml template file "order/view/info.phtml" and add the code to display your GST below billing address section. Refer below code sample.

app/code/Company/Module/view/adminhtml/layout/sales_order_view.xml

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="order_info">
            <action method="setTemplate">
                <argument name="template" xsi:type="string">Company_Module::order/view/info.phtml</argument>
            </action>
        </referenceBlock>
    </body>
</page>

Add below code to your info.phtml to the section below billing address (DON'T REPLACE THE ENTIRE CONTENT).

app/code/Company/Module/view/adminhtml/templates/order/view/info.phtml

<?php echo $block->getOrder()->getGst();?>


Answered By - Nidheesh
Answer Checked By - Mildred Charles (PHPFixing Admin)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing