Let’s initiate a discussion!!
Today we are going to write that how to add a custom column in the sales order grid and show that custom column in the shipment grid.
Firstly, you need to add that column in the sales_shipment table and sales_shipment_grid table via declarative scema.
You need to add this file to the custom module
Magemonkeys/ModuleName/view/adminhtml/ui_component/sales_order_shipment_grid.xml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
<?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_shipment_columns"> <column name="new_fieldname"> <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">New field column name</item> <item name="visible" xsi:type="boolean">false</item> </item> </argument> </column> </columns> </listing> |
Copy column value to grid table.
For that need to create di.xml file in Magemonkeys/ModuleName/etc/
1 2 3 4 5 6 7 8 9 10 |
<?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <virtualType name="Magento\Sales\Model\ResourceModel\Order\Shipment\Grid" type="Magento\Sales\Model\ResourceModel\Grid"> <arguments> <argument name="columns"> <item name="new_fieldname" xsi:type="string">sales_shipment.new_fieldname</item> </argument> </arguments> </virtualType> </config> |
That’s it.
[crayon-641f0d468b8c4955994675/] Using above fucntion Images can be imported directly from...
Override view block using di.xml and add the below code...
You can check a list of called layout XML for...
Follow the below steps to install and set up PWA...
If you want to remove all leading zero's from order,...
Let our Magento expert connect to discuss your requirement.
We offer Magento
certified developers.
Our Magento clientele
is 500+.
We sign NDA for the
security of your projects.
We’ve performed 100+
Magento migration projects.
Free quotation
on your project.
Three months warranty on
code developed by us.