Before following the below steps, you can create the order attribute and store it into the value.
Step 1: Create module.xml file under app/code/Vendor/Modulename/etc directory and registration.php file under app/code/Vendor/Modulename directory.
Step 2: Create sales_order_shipment_grid.xml file under app/code/Vendor/Modulename/view/adminhtml/ui_component directory with below code
1 2 3 4 5 6 7 8 9 10 11 12 13 |
<?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="custcolumn" class="Vendor\Modulename\Ui\Component\Listing\Column\Custcolumn"> <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">Custom Column</item> </item> </argument> </column> </columns> </listing> |
Step 3: Create Custcolumn.php ui component class file under app/code/Vendor/Modulename/Ui/Component/Listing/Column directory with below code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
<?php namespace Vendor\Modulename\Ui\Component\Listing\Column; use \Magento\Sales\Api\OrderRepositoryInterface; use \Magento\Framework\View\Element\UiComponent\ContextInterface; use \Magento\Framework\View\Element\UiComponentFactory; use \Magento\Ui\Component\Listing\Columns\Column; use \Magento\Framework\Api\SearchCriteriaBuilder; class Custcolumn extends Column { protected $_orderRepository; protected $_searchCriteria; protected $_customfactory; public function __construct( ContextInterface $context, UiComponentFactory $uiComponentFactory, OrderRepositoryInterface $orderRepository, SearchCriteriaBuilder $criteria, \Magento\Framework\App\ResourceConnection $resource, \Magento\Sales\Model\OrderFactory $orderFactory, array $components = [], array $data = []) { $this->_orderRepository = $orderRepository; $this->_searchCriteria = $criteria; $this->resource = $resource; $this->orderFactory = $orderFactory; parent::__construct($context, $uiComponentFactory, $components, $data); } public function prepareDataSource(array $dataSource) { if (isset($dataSource['data']['items'])) { $connection = $this->resource->getConnection(); $tableName = $connection->getTableName('sales_shipment_grid'); foreach ($dataSource['data']['items'] as & $item) { $order = $this->orderFactory->create()->loadByIncrementId($item["order_increment_id"]); if($order->getCustcolumn()){ $item['custcolumn'] = $order->getCustcolumn(); } } } return $dataSource; } } |
If you want get query string params in controller file,...
Create di.xml and add the below code Magemonkey/Redirect/etc/frontend/di.xml [crayon-62837c149a4a6555750282/] Create...
You can try below code to change local date to...
Step 1: First you need to add registration.php file in...
Step1 : Override message.js in current theme file on the...