Magento – Magento 2 – How to change sales order grid column label

magento-2.1magento2sales-order-grid

How could i change this label? Tried with sales_order_grid.xml didn't work.

image

<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
<listingToolbar name="listing_top">
    <settings>
        <sticky>true</sticky>
    </settings>
    <bookmark name="bookmarks"/>
    <columnsControls name="columns_controls"/>
    <exportButton name="export_button"/>
    <filterSearch name="fulltext"/>
    <filters name="listing_filters">
        <filterSelect name="store_id" provider="${ $.parentName }">
            <settings>
                <options class="Magento\Store\Ui\Component\Listing\Column\Store\Options"/>
                <caption translate="true">All Store Views</caption>
                <label translate="true">Purchase Point</label>
                <dataScope>store_id</dataScope>
                <imports>
                    <link name="visible">ns = ${ $.ns }, componentType = column, index = ${ $.index }:visible</link>
                </imports>
            </settings>
        </filterSelect>
    </filters>
    <massaction name="listing_massaction" component="Magento_Ui/js/grid/tree-massactions">
        <action name="cancel">
            <settings>
                <url path="sales/order/massCancel"/>
                <type>cancel</type>
                <label translate="true">Cancel</label>
            </settings>
        </action>
        <action name="hold_order">
            <settings>
                <url path="sales/order/massHold"/>
                <type>hold_order</type>
                <label translate="true">Hold</label>
            </settings>
        </action>
        <action name="unhold_order">
            <settings>
                <url path="sales/order/massUnhold"/>
                <type>unhold_order</type>
                <label translate="true">Unhold</label>
            </settings>
        </action>
        <action name="pdfinvoices_order">
            <settings>
                <url path="sales/order/pdfinvoices"/>
                <type>pdfinvoices_order</type>
                <label translate="true">Print Invoices</label>
            </settings>
        </action>
        <action name="pdfshipments_order">
            <settings>
                <url path="sales/order/pdfshipments"/>
                <type>pdfshipments_order</type>
                <label translate="true">Print Packing Slips</label>
            </settings>
        </action>
        <action name="pdfcreditmemos_order">
            <settings>
                <url path="sales/order/pdfcreditmemos"/>
                <type>pdfcreditmemos_order</type>
                <label translate="true">Print Credit Memos</label>
            </settings>
        </action>
        <action name="pdfdocs_order">
            <settings>
                <url path="sales/order/pdfdocs"/>
                <type>pdfdocs_order</type>
                <label translate="true">Print All</label>
            </settings>
        </action>
        <action name="print_shipping_label">
            <settings>
                <url path="adminhtml/order_shipment/massPrintShippingLabel"/>
                <type>print_shipping_label</type>
                <label translate="true">Print Shipping Labels</label>
            </settings>
        </action>
    </massaction>
    <paging name="listing_paging"/>
</listingToolbar>
<columns name="sales_order_columns">
    <column name="base_grand_total" class="Magento\Sales\Ui\Component\Listing\Column\Price">
        <settings>
            <filter>textRange</filter>
            <label translate="true">Gift Cards Total</label>
        </settings>
    </column>
    <column name="grand_total" class="Magento\Sales\Ui\Component\Listing\Column\PurchasedPrice">
        <settings>
            <filter>textRange</filter>
            <label translate="true">Order Total</label>
        </settings>
    </column>
    <column name="shipping_name">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="componentDisabled" xsi:type="boolean">true</item>
            </item>
        </argument>
    </column>
    <column name="billing_address">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="componentDisabled" xsi:type="boolean">true</item>
            </item>
        </argument>
    </column>
    <column name="shipping_address">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="componentDisabled" xsi:type="boolean">true</item>
            </item>
        </argument>
    </column>
    <column name="shipping_information">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="componentDisabled" xsi:type="boolean">true</item>
            </item>
        </argument>
    </column>
    <column name="shipping_and_handling">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="componentDisabled" xsi:type="boolean">true</item>
            </item>
        </argument>
    </column>
    <column name="payment_method">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="componentDisabled" xsi:type="boolean">true</item>
            </item>
        </argument>
    </column>
    <column name="total_refunded">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="componentDisabled" xsi:type="boolean">true</item>
            </item>
        </argument>
    </column>
    <column name="signifyd_guarantee_decision">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="componentDisabled" xsi:type="boolean">true</item>
            </item>
        </argument>
    </column>
    <column name="mailchimp">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="componentDisabled" xsi:type="boolean">true</item>
            </item>
        </argument>
    </column>
    <column name="fee">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="filter" xsi:type="string">text</item>
                <item name="label" xsi:type="string" translate="true">Service Fee Total</item>
                <item name="visible" xsi:type="boolean">false</item>
            </item>
        </argument>
    </column> 
    <column name="fundraised">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="filter" xsi:type="string">text</item>
                <item name="label" xsi:type="string" translate="true">Funds Raised Total</item>
                <item name="visible" xsi:type="boolean">false</item>
            </item>
        </argument>
    </column>
</columns>

Best Answer

Override sales_order_grid.xml ui_component file in your module

app/code/[vendore]/[Module]/view/adminhtml/ui_component/sales_order_grid.xml

 <?xml version="1.0" encoding="UTF-8"?>
<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
<columns name="sales_order_columns">
    <column name="base_grand_total" class="Magento\Sales\Ui\Component\Listing\Column\Price">
        <settings>
            <filter>textRange</filter>
            <label translate="true">Grand Total (Base) 1</label>
        </settings>
    </column>
</columns>
</listing>

https://prnt.sc/o4o6eg

You can check it here. http://easyndfaster.com/blog/post/magento-2-how-to-change-sales-order-grid-column-label/

It's work.

Related Topic