如何在管理面板中显示自定义结帐字段
How to show custom checkout filed in admin panel
如何在管理面板中显示自定义字段。
table sales_order,quote cullom name gst
我想在销售订单中显示一个字段。
代码详情 click here
enter image description here
您可以覆盖 adminhtml 模板文件 "order/view/info.phtml" 并添加代码以在账单地址部分下方显示您的 GST。参考下面的代码示例。
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>
将以下代码添加到您的 info.phtml 帐单地址下方部分(不要替换全部内容)。
app/code/Company/Module/view/adminhtml/templates/order/view/info.phtml
<?php echo $block->getOrder()->getGst();?>
如何在管理面板中显示自定义字段。
table sales_order,quote cullom name gst
我想在销售订单中显示一个字段。 代码详情 click here
enter image description here
您可以覆盖 adminhtml 模板文件 "order/view/info.phtml" 并添加代码以在账单地址部分下方显示您的 GST。参考下面的代码示例。
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>
将以下代码添加到您的 info.phtml 帐单地址下方部分(不要替换全部内容)。
app/code/Company/Module/view/adminhtml/templates/order/view/info.phtml
<?php echo $block->getOrder()->getGst();?>