{"id":18789,"date":"2019-02-07T14:55:05","date_gmt":"2019-02-07T12:55:05","guid":{"rendered":"https:\/\/belvg.com\/blog\/?p=18789"},"modified":"2019-12-04T11:34:53","modified_gmt":"2019-12-04T09:34:53","slug":"how-to-add-column-in-sales-order-grid-in-magento","status":"publish","type":"post","link":"https:\/\/belvg.com\/blog\/how-to-add-column-in-sales-order-grid-in-magento.html","title":{"rendered":"How to Add Column in Sales Order Grid in Magento"},"content":{"rendered":"\n<p>Nearly 3 years have passed since the publication of the <a href=\"https:\/\/belvg.com\/blog\/how-to-add-column-in-sales-order-grid-in-magento-2-1.html\" target=\"_blank\" rel=\"noopener\">How to Add Column in Sales Order Grid in Magento 2.1<\/a> article. Over this time two new versions &ndash; Magento 2.2 and 2.3 &ndash; have been released.<\/p>\n<p><!--more--><\/p>\n<p>With the introduction of new versions, the syntax of UI Components has also been updated. Therefore, it seemed logical to update the article and adapt the code for Magento 2.3. There are few intuitive changes in the code that affected <em>sales_order_grid.xml<\/em> file.<\/p>\n<pre class=\"lang:default decode:true \">&lt;code&gt;\r\n&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;\r\n&lt;listing xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\"\r\n        xsi:noNamespaceSchemaLocation=\"urn:magento:module:Magento_Ui:etc\/ui_configuration.xsd\"&gt;\r\n   &lt;columns name=\"sales_order_columns\"&gt;\r\n       &lt;column name=\"rics_status\" class=\"Belvg\\ColumnToOrderGrid\\Ui\\Component\\Columns\\OrderGrid\"&gt;\r\n           &lt;settings&gt;\r\n               &lt;filter&gt;select&lt;\/filter&gt;\r\n               &lt;options class=\"Belvg\\ColumnToOrderGrid\\Model\\Config\\Statuses\"\/&gt;\r\n               &lt;visible&gt;true&lt;\/visible&gt;\r\n               &lt;dataType&gt;select&lt;\/dataType&gt;\r\n               &lt;label translate=\"true\"&gt;Example column&lt;\/label&gt;\r\n               &lt;bodyTmpl&gt;ui\/grid\/cells\/html&lt;\/bodyTmpl&gt;\r\n               &lt;sortable&gt;false&lt;\/sortable&gt;\r\n           &lt;\/settings&gt;\r\n       &lt;\/column&gt;\r\n   &lt;\/columns&gt;\r\n&lt;\/listing&gt;\r\n\r\n&lt;\/code&gt;\r\n<\/pre>\n<p>The changes mainly affected the xml structure of the Ui component document. Also, xml attributes became xml element. In my opinion, the new code is more readable and understandable. Link to the updated module: <a href=\"https:\/\/github.com\/Galillei\/sample_add_columns_to_order_grid\/tree\/2.3\" target=\"_blank\" rel=\"noopener\">https:\/\/github.com\/Galillei\/sample_add_columns_to_order_grid\/tree\/2.3<\/a><\/p>\n<p>Magento 2 UI components serve for generation and display of several lists and grid types. Moreover, you can create a component yourself on the basis of the already existing code; yet the description of this mechanism is worthy of a separate article. For this one, we will focus on extending the sales order grid with an additional column.<\/p>\n<div class=\"module_in_content_container\"><a href=\"https:\/\/belvg.com\/magento-audit\" class=\"link_to_module\" target=\"_blank\" rel=\"noopener\"><\/a><div class=\"module_content\"><div class=\"module_content_part\"><h3 class=\"title\">Magento Audit<\/h3><p class=\"module_content_text\">Take your online store to the next level with BelVG Magento Audit<\/p><a href=\"https:\/\/belvg.com\/magento-audit\" class=\"link_2_to_module\" target=\"_blank\" style=\"display:inline-block\" rel=\"noopener\"><span class=\"read-more\">Visit the page<\/span><\/a><\/div><\/div><\/div>\n<p>Actually, it&rsquo;s rather simple to add a new column to a grid, unlike, for example, create a new column with filtering. So let me describe how to implement it in Magento 2.3.<\/p>\n<p><strong>NB!<\/strong> The code in XML format I will put below is valid solely for versions 2.3 and further. If you still use earlier versions of Magento, I strongly advise you to migrate to Magento 2.<\/p>\n<p>All the directives are situated in the <em>&lt;module&gt;\/view\/adminhtml\/ui_component\/<\/em> directory. First, create a &ldquo;<em>sales_order_grid.xml<\/em>&rdquo; file. The filename has to match a parent component that we will extend.<\/p>\n<p>Let&rsquo;s add the following code into the file:<\/p>\n<pre class=\"lang:default decode:true \">&lt;code&gt;\r\n&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;\r\n&lt;listing xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\"\r\n        xsi:noNamespaceSchemaLocation=\"urn:magento:module:Magento_Ui:etc\/ui_configuration.xsd\"&gt;\r\n   &lt;columns name=\"sales_order_columns\"&gt;\r\n       &lt;column name=\"rics_status\" class=\"Belvg\\ColumnToOrderGrid\\Ui\\Component\\Columns\\OrderGrid\"&gt;\r\n           &lt;settings&gt;\r\n               &lt;filter&gt;select&lt;\/filter&gt;\r\n               &lt;options class=\"Belvg\\ColumnToOrderGrid\\Model\\Config\\Statuses\"\/&gt;\r\n               &lt;visible&gt;true&lt;\/visible&gt;\r\n               &lt;dataType&gt;select&lt;\/dataType&gt;\r\n               &lt;label translate=\"true\"&gt;Example column&lt;\/label&gt;\r\n               &lt;bodyTmpl&gt;ui\/grid\/cells\/html&lt;\/bodyTmpl&gt;\r\n               &lt;sortable&gt;false&lt;\/sortable&gt;\r\n           &lt;\/settings&gt;\r\n       &lt;\/column&gt;\r\n   &lt;\/columns&gt;\r\n&lt;\/listing&gt;\r\n&lt;\/code&gt;\r\n<\/pre>\n<p>Let me break this piece of code down.<\/p>\n<p>The line<\/p>\n<pre class=\"lang:default decode:true \">&lt;code&gt;\r\n &lt;column name=\"rics_status\" class=\"Belvg\\ColumnToOrderGrid\\Ui\\Component\\Columns\\OrderGrid\"&gt;\r\n&lt;\/code\r\n<\/pre>\n<p>adds a column into the order grid. Class <em>Module\\Ui\\Component\\Columns\\OrderGrid<\/em> extends the <em>Magento\\Ui\\Component\\Listing\\Columns\\Column<\/em> class.<\/p>\n<p>We need to override the <em>prepareDataSource()<\/em> method:<\/p>\n<pre class=\"lang:default decode:true \">&lt;code&gt;\r\npublic function prepareDataSource(array $dataSource)\r\n{\r\n    if (isset($dataSource['data']['items'])) {\r\n        foreach ($dataSource['data']['items'] as &amp;$item) {\r\n            \/\/put logic here\r\n        }\r\n    }\r\n    return $dataSource;\r\n}\r\n&lt;\/code&gt;\r\n<\/pre>\n<p><em> $item<\/em> variable stores current grid row data, and the column name is available in the &ldquo;name&rdquo; array element:<\/p>\n<pre class=\"lang:default decode:true \">&lt;code&gt;\r\n$item[$this-&gt;getData('name')] = $value;\r\n&lt;\/code&gt;\r\n<\/pre>\n<p>This way we can fill the row data.<\/p>\n<p>Let&rsquo;s now return to the <em>sales_order_grid.xml<\/em> file. All the code written in the argument line and below is related to the column description.<\/p>\n<pre class=\"lang:default decode:true \">&lt;code&gt;\r\n&lt;bodyTmpl&gt;ui\/grid\/cells\/html&lt;\/bodyTmpl&gt;\r\n&lt;\/code&gt;\r\n<\/pre>\n<p>The following line allows us to render any valid HTML code in the cell. Magento 2 supports a few pre-defined template renders out of the box, all of them are placed in module-ui.<\/p>\n<p>In the following example the component isn&rsquo;t specified, but we can additionally specify the column component in argument tag as well:<\/p>\n<pre class=\"lang:default decode:true \">&lt;code&gt;\r\n&lt;column name=\"created_at\" class=\"Magento\\Ui\\Component\\Listing\\Columns\\Date\" component=\"Magento_Ui\/js\/grid\/columns\/date\" sortOrder=\"30\"&gt;\r\n&lt;\/code&gt;\r\n<\/pre>\n<p><strong>NB!<\/strong> In the earlier versions of Magento the component was installed in a different way:<\/p>\n<pre class=\"lang:default decode:true \">&lt;code&gt;\r\n&lt;item name=\"component\" xsi:type=\"string\"&gt;Magento_Ui\/js\/grid\/columns\/date&lt;\/item&gt;\r\n&lt;\/code&gt;\r\n<\/pre>\n<p>The type of column (date, column, actions, multiselect, select or thumbnail) to use is defined by the component. Both templates and components are placed in the module-ui. At this stage, there is already a column in the order grid and the task is completed. However, if you require filtering by this column, we will proceed to work.<\/p>\n<p>There are 2 solutions:<\/p>\n<ul>\n<li>Adding our column into <em>sales_order<\/em> and <em>sales_order_grid<\/em> tables and control CRUD operations for the sales_order table (<em>sales_order_grid<\/em> table and <em>sales_order<\/em> table are synchronized by cron).<\/li>\n<li>Writing a new plugin for a fast column update.<\/li>\n<\/ul>\n<p>The first way left me with the excess of data and compatibility reduction; that is why I decided to resort to the second method &ndash; plugin filtering. I began with adding the filter into <em>sales_order_grid.xml<\/em> file and then added the following code right after the close tag:<\/p>\n<pre class=\"lang:default decode:true \">&lt;code&gt;\r\n&lt;filter&gt;select&lt;\/filter&gt;\r\n&lt;\/code&gt;\r\n<\/pre>\n<p>In the line:<\/p>\n<pre class=\"lang:default decode:true \">&lt;code&gt;\r\n&lt;options class=\"Belvg\\ColumnToOrderGrid\\Model\\Config\\Statuses\"\/&gt;\r\n&lt;\/code&gt;\r\n<\/pre>\n<p>I specified the class in which the filter value will be defined. This class should carry out <em>\\Magento\\Framework\\Data\\OptionSourceInterface<\/em> interface.<\/p>\n<p>The collection class for the order sales is <em>sales_order_grid_data_source<\/em>, defined in <em>vendor\/magento\/module-sales\/etc\/di.xml<\/em>:<\/p>\n<pre class=\"lang:default decode:true \">&lt;code&gt;\r\n&lt;type name=\"Magento\\Framework\\View\\Element\\UiComponent\\DataProvider\\CollectionFactory\"&gt;\r\n   &lt;arguments&gt;\r\n   \t&lt;argument name=\"collections\" xsi:type=\"array\"&gt;\r\n   \t\t&lt;item name=\"sales_order_grid_data_source\" xsi:type=\"string\"&gt;Magento\\Sales\\Model\\ResourceModel\\Order\\Grid\\Collection&lt;\/item&gt;\r\n \r\n&lt;\/code&gt;\r\n<\/pre>\n<p>Therefore, we use the collection as a filtering source. And now we apply the plugin that adds our data into filtering results.<\/p>\n<p>Now let&rsquo;s register the plugin in <em>etc\/di.xml<\/em>:<\/p>\n<pre class=\"lang:default decode:true \">&lt;type name=\"Magento\\Framework\\View\\Element\\UiComponent\\DataProvider\\CollectionFactory\"&gt;\r\n    &lt;plugin\r\n            name=\"sales_order_additional_columns\"\r\n            type=\"Module\\Plugin\\AdditionalFields\\CollectionFactory\"\r\n            sortOrder=\"100\"\r\n            disabled=\"false\"\r\n    \/&gt;\r\n&lt;\/type&gt;\r\n<\/pre>\n<p>And add <em>Module\\Plugin\\AdditionalFields\\CollectionFactory::aroundGetReport()<\/em> method.<\/p>\n<pre class=\"lang:default decode:true \">public function aroundGetReport(\r\n    \\Magento\\Framework\\View\\Element\\UiComponent\\DataProvider\\CollectionFactory $subject,\r\n    \\Closure $proceed,\r\n    $requestName\r\n)\r\n{\r\n    $result = $proceed($requestName);\r\n    if ($requestName == 'sales_order_grid_data_source') {\r\n        if ($result instanceof Magento\\Sales\\Model\\ResourceModel\\Order\\Grid\\Collection) {\r\n            \/\/add code to join table, and mapping field to select\r\n        }\r\n    }\r\n    return $result;\r\n}\r\n<\/pre>\n<p>Current field filtering should become available after the plugin installation. As a result, we get the following:<\/p>\n<p><a href=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/02\/add_column_in_admin_sales_grid.png\"><img decoding=\"async\" loading=\"lazy\" class=\"lazy aligncenter size-full wp-image-18791\" src=\"https:\/\/belvg.com\/wp-content\/uploads\/2019\/06\/pixel.png\" data-src=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/02\/add_column_in_admin_sales_grid.png\" alt=\"add_column_in_admin_sales_grid\" width=\"602\" height=\"349\" title=\"How to Add Column in Sales Order Grid in Magento\"><\/a><\/p>\n<p>You can find the described above module here: <a href=\"https:\/\/github.com\/Galillei\/sample_add_columns_to_order_grid\/tree\/2.3\" target=\"_blank\" rel=\"noopener\">https:\/\/github.com\/Galillei\/sample_add_columns_to_order_grid\/tree\/2.3<\/a>.<\/p>\n<p>Bear in mind that Magento has kept the compatibility with the old ui-components structure, which means that the code for 2.1 version may work for 2.3 as well. In this very article, we demonstrated how to describe ui-components using the new syntax.<\/p>\n<div class=\"module_in_content_container\"><a href=\"https:\/\/belvg.com\/magento-custom-development\" class=\"link_to_module\" target=\"_blank\" rel=\"noopener\"><\/a><div class=\"module_content\"><img src=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/01\/magento-custom-development.png\" width=\"120\" height=\"120\" alt=\"magento custom development\" class=\"module_image\" title=\"How to Add Column in Sales Order Grid in Magento\"><div class=\"module_content_part\"><h3 class=\"title\">Magento Custom Development<\/h3><p class=\"module_content_text\">Take your online store to the next level with BelVG Magento Custom Development <\/p><a href=\"https:\/\/belvg.com\/magento-custom-development\" class=\"link_2_to_module\" target=\"_blank\" style=\"display:inline-block\" rel=\"noopener\"><span class=\"read-more\">Visit the page<\/span><\/a><\/div><\/div><\/div>\n\n","protected":false},"excerpt":{"rendered":"Nearly 3 years have passed since the publication of the How to Add Column in &#8230;","protected":false},"author":47,"featured_media":18790,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"image","meta":{"_acf_changed":false,"footnotes":""},"categories":[14,491,389,471,524,526],"tags":[],"class_list":["post-18789","post","type-post","status-publish","format-image","has-post-thumbnail","hentry","category-magento","category-magento-2","category-magento2-development","category-magento-developer","category-magento-speed-optimization","category-magento-theme","post_format-post-format-image"],"acf":[],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.4 - aioseo.com -->\n\t<meta name=\"description\" content=\"Learn how to Add Column in Sales Order Grid in Magento after Magento 2.2 and 2.3 have been released. Use these instructions and this user guide to update your website.\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Artsem Miklashevich\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/belvg.com\/blog\/how-to-add-column-in-sales-order-grid-in-magento.html\" \/>\n\t\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.4\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/how-to-add-column-in-sales-order-grid-in-magento.html#article\",\"name\":\"How to Add Column in Sales Order Grid in Magento | BelVG Blog\",\"headline\":\"How to Add Column in Sales Order Grid in Magento\",\"author\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/author\\\/artsem-miklashevich#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/#organization\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/belvg.com\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/02\\\/cv.png\",\"width\":1108,\"height\":590,\"caption\":\"How to Add Column in Sales Order Grid in Magento\"},\"datePublished\":\"2019-02-07T14:55:05+02:00\",\"dateModified\":\"2019-12-04T11:34:53+02:00\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/how-to-add-column-in-sales-order-grid-in-magento.html#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/how-to-add-column-in-sales-order-grid-in-magento.html#webpage\"},\"articleSection\":\"Magento, Magento 2, Magento 2 Development, Magento Developer, Magento Speed Optimization, Magento Theme, Image\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/how-to-add-column-in-sales-order-grid-in-magento.html#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/belvg.com\\\/blog\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/category\\\/magento#listItem\",\"name\":\"Magento\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/category\\\/magento#listItem\",\"position\":2,\"name\":\"Magento\",\"item\":\"https:\\\/\\\/belvg.com\\\/blog\\\/category\\\/magento\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/how-to-add-column-in-sales-order-grid-in-magento.html#listItem\",\"name\":\"How to Add Column in Sales Order Grid in Magento\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/how-to-add-column-in-sales-order-grid-in-magento.html#listItem\",\"position\":3,\"name\":\"How to Add Column in Sales Order Grid in Magento\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/category\\\/magento#listItem\",\"name\":\"Magento\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/#organization\",\"name\":\"BelVG Blog\",\"description\":\"Magento and Prestashop articles\",\"url\":\"https:\\\/\\\/belvg.com\\\/blog\\\/\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/author\\\/artsem-miklashevich#author\",\"url\":\"https:\\\/\\\/belvg.com\\\/blog\\\/author\\\/artsem-miklashevich\",\"name\":\"Artsem Miklashevich\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/how-to-add-column-in-sales-order-grid-in-magento.html#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/145dc6a225439ebb3a257da8fd0f46383a3649cdca2e58190b33a28af5f216a5?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"Artsem Miklashevich\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/how-to-add-column-in-sales-order-grid-in-magento.html#webpage\",\"url\":\"https:\\\/\\\/belvg.com\\\/blog\\\/how-to-add-column-in-sales-order-grid-in-magento.html\",\"name\":\"How to Add Column in Sales Order Grid in Magento | BelVG Blog\",\"description\":\"Learn how to Add Column in Sales Order Grid in Magento after Magento 2.2 and 2.3 have been released. Use these instructions and this user guide to update your website.\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/how-to-add-column-in-sales-order-grid-in-magento.html#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/author\\\/artsem-miklashevich#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/author\\\/artsem-miklashevich#author\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/belvg.com\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/02\\\/cv.png\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/how-to-add-column-in-sales-order-grid-in-magento.html\\\/#mainImage\",\"width\":1108,\"height\":590,\"caption\":\"How to Add Column in Sales Order Grid in Magento\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/how-to-add-column-in-sales-order-grid-in-magento.html#mainImage\"},\"datePublished\":\"2019-02-07T14:55:05+02:00\",\"dateModified\":\"2019-12-04T11:34:53+02:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/belvg.com\\\/blog\\\/\",\"name\":\"BelVG Blog\",\"description\":\"Magento and Prestashop articles\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"How to Add Column in Sales Order Grid in Magento | BelVG Blog","description":"Learn how to Add Column in Sales Order Grid in Magento after Magento 2.2 and 2.3 have been released. Use these instructions and this user guide to update your website.","canonical_url":"https:\/\/belvg.com\/blog\/how-to-add-column-in-sales-order-grid-in-magento.html","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/belvg.com\/blog\/how-to-add-column-in-sales-order-grid-in-magento.html#article","name":"How to Add Column in Sales Order Grid in Magento | BelVG Blog","headline":"How to Add Column in Sales Order Grid in Magento","author":{"@id":"https:\/\/belvg.com\/blog\/author\/artsem-miklashevich#author"},"publisher":{"@id":"https:\/\/belvg.com\/blog\/#organization"},"image":{"@type":"ImageObject","url":"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/02\/cv.png","width":1108,"height":590,"caption":"How to Add Column in Sales Order Grid in Magento"},"datePublished":"2019-02-07T14:55:05+02:00","dateModified":"2019-12-04T11:34:53+02:00","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/belvg.com\/blog\/how-to-add-column-in-sales-order-grid-in-magento.html#webpage"},"isPartOf":{"@id":"https:\/\/belvg.com\/blog\/how-to-add-column-in-sales-order-grid-in-magento.html#webpage"},"articleSection":"Magento, Magento 2, Magento 2 Development, Magento Developer, Magento Speed Optimization, Magento Theme, Image"},{"@type":"BreadcrumbList","@id":"https:\/\/belvg.com\/blog\/how-to-add-column-in-sales-order-grid-in-magento.html#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/belvg.com\/blog\/#listItem","position":1,"name":"Home","item":"https:\/\/belvg.com\/blog\/","nextItem":{"@type":"ListItem","@id":"https:\/\/belvg.com\/blog\/category\/magento#listItem","name":"Magento"}},{"@type":"ListItem","@id":"https:\/\/belvg.com\/blog\/category\/magento#listItem","position":2,"name":"Magento","item":"https:\/\/belvg.com\/blog\/category\/magento","nextItem":{"@type":"ListItem","@id":"https:\/\/belvg.com\/blog\/how-to-add-column-in-sales-order-grid-in-magento.html#listItem","name":"How to Add Column in Sales Order Grid in Magento"},"previousItem":{"@type":"ListItem","@id":"https:\/\/belvg.com\/blog\/#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/belvg.com\/blog\/how-to-add-column-in-sales-order-grid-in-magento.html#listItem","position":3,"name":"How to Add Column in Sales Order Grid in Magento","previousItem":{"@type":"ListItem","@id":"https:\/\/belvg.com\/blog\/category\/magento#listItem","name":"Magento"}}]},{"@type":"Organization","@id":"https:\/\/belvg.com\/blog\/#organization","name":"BelVG Blog","description":"Magento and Prestashop articles","url":"https:\/\/belvg.com\/blog\/"},{"@type":"Person","@id":"https:\/\/belvg.com\/blog\/author\/artsem-miklashevich#author","url":"https:\/\/belvg.com\/blog\/author\/artsem-miklashevich","name":"Artsem Miklashevich","image":{"@type":"ImageObject","@id":"https:\/\/belvg.com\/blog\/how-to-add-column-in-sales-order-grid-in-magento.html#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/145dc6a225439ebb3a257da8fd0f46383a3649cdca2e58190b33a28af5f216a5?s=96&d=mm&r=g","width":96,"height":96,"caption":"Artsem Miklashevich"}},{"@type":"WebPage","@id":"https:\/\/belvg.com\/blog\/how-to-add-column-in-sales-order-grid-in-magento.html#webpage","url":"https:\/\/belvg.com\/blog\/how-to-add-column-in-sales-order-grid-in-magento.html","name":"How to Add Column in Sales Order Grid in Magento | BelVG Blog","description":"Learn how to Add Column in Sales Order Grid in Magento after Magento 2.2 and 2.3 have been released. Use these instructions and this user guide to update your website.","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/belvg.com\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/belvg.com\/blog\/how-to-add-column-in-sales-order-grid-in-magento.html#breadcrumblist"},"author":{"@id":"https:\/\/belvg.com\/blog\/author\/artsem-miklashevich#author"},"creator":{"@id":"https:\/\/belvg.com\/blog\/author\/artsem-miklashevich#author"},"image":{"@type":"ImageObject","url":"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2019\/02\/cv.png","@id":"https:\/\/belvg.com\/blog\/how-to-add-column-in-sales-order-grid-in-magento.html\/#mainImage","width":1108,"height":590,"caption":"How to Add Column in Sales Order Grid in Magento"},"primaryImageOfPage":{"@id":"https:\/\/belvg.com\/blog\/how-to-add-column-in-sales-order-grid-in-magento.html#mainImage"},"datePublished":"2019-02-07T14:55:05+02:00","dateModified":"2019-12-04T11:34:53+02:00"},{"@type":"WebSite","@id":"https:\/\/belvg.com\/blog\/#website","url":"https:\/\/belvg.com\/blog\/","name":"BelVG Blog","description":"Magento and Prestashop articles","inLanguage":"en-US","publisher":{"@id":"https:\/\/belvg.com\/blog\/#organization"}}]}},"aioseo_meta_data":{"post_id":"18789","title":null,"description":"Learn how to Add Column in Sales Order Grid in Magento after Magento 2.2 and 2.3 have been released. Use these instructions and this user guide to update your website.","keywords":null,"keyphrases":null,"focus_keyword":null,"additional_keywords":null,"truseo_locale":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_custom_url":null,"og_image_custom_fields":null,"og_image_url":null,"og_image_width":null,"og_image_height":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_image_url":null,"twitter_title":null,"twitter_description":null,"schema_type":"default","schema_type_options":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"limit_modified_date":false,"ai":null,"breadcrumb_settings":null,"seo_analyzer_scan_date":null,"created":"2026-11-03 18:36:54","updated":"2026-11-03 18:36:54"},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/belvg.com\/blog\/\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">\u00bb<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/belvg.com\/blog\/category\/magento\" title=\"Magento\">Magento<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">\u00bb<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tHow to Add Column in Sales Order Grid in Magento\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/belvg.com\/blog\/"},{"label":"Magento","link":"https:\/\/belvg.com\/blog\/category\/magento"},{"label":"How to Add Column in Sales Order Grid in Magento","link":"https:\/\/belvg.com\/blog\/how-to-add-column-in-sales-order-grid-in-magento.html"}],"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/posts\/18789","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/users\/47"}],"replies":[{"embeddable":true,"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/comments?post=18789"}],"version-history":[{"count":-2,"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/posts\/18789\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/media\/18790"}],"wp:attachment":[{"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/media?parent=18789"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/categories?post=18789"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/tags?post=18789"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}