Question

Order Tab is showing Blank when i click on the following path in admin panel:

Customers->Edit(Particular Customer)->Click on Order Tab of Customer

Information Section. This is the screenshot Blank Order Tab

Please help me for solve this issue in Magento-2.2.7

Was it helpful?

Solution

Try this:

EDIT:

Add in or add an InstallSchema.php from this path of your custom module:

Vendor/Module/Setup/InstallSchema.php

<?php

namespace vendor\module\Setup;

use Magento\Framework\Setup\InstallSchemaInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\SchemaSetupInterface;

class InstallSchema implements InstallSchemaInterface
{

/**
 * {@inheritdoc}
 * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
 */
public function install(SchemaSetupInterface $setup, ModuleContextInterface $context)
{
    $installer = $setup;

    $installer->startSetup();

    /* While module install, creates column in sales_order_grid table */

    $eavTable = $installer->getTable('sales_order_grid');

    $columns = [
        'quote_id' => [
            'type' => \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER,
            'nullable' => true,
            'comment' => 'Quote Id',
        ],
    ];

    $connection = $installer->getConnection();
    foreach ($columns as $name => $definition) {
        $connection->addColumn($eavTable, $name, $definition);
       }

    $installer->endSetup();
}
}

Add this line in your di.xml

<virtualType name="Magento\Sales\Model\ResourceModel\Order\Grid" type="Magento\Sales\Model\ResourceModel\Grid">
    <arguments>
        <argument name="columns" xsi:type="array">
            <item name="quote_id" xsi:type="string">sales_order.quote_id</item>
        </argument>
    </arguments>
</virtualType>  

Then create a sales_order_grid.xml from this path of your custom_module:

Vendor/Module/view/adminhtml/ui_component

<?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="quote_id">
            <argument name="data" xsi:type="array">
            <item name="js_config" xsi:type="array">
                <item name="component" xsi:type="string">Magento_Ui/js/grid/columns/column</item>
            </item>
            <item name="config" xsi:type="array">
                <item name="visible" xsi:type="boolean">true</item>
                <item name="dataType" xsi:type="string">text</item>
                <item name="align" xsi:type="string">left</item>
                <item name="label" xsi:type="string" translate="true">Quote Id</item>
            </item>
        </argument>
        </column>
    </columns>
</listing>  

Note: Don't forget to run setup:upgrade then setup:static-content:deploy after.

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top