I want to add a Customer Group in a Customer grid during order creation For Magento2. I made
[vendor]\[module]\view\adminhtml\layout\sales_order_create_customer_block.xml
like this:
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="adminhtml.customer.grid.container">
<arguments>
<argument name="dataSource" xsi:type="object">\[vendor]\[module]\Model\ResourceModel\Order\Customer\Collection</argument>
</arguments>
</referenceBlock>
<referenceBlock name="adminhtml.customer.grid.columnSet">
<block class="Magento\Backend\Block\Widget\Grid\Column" as="group" after="name">
<arguments>
<argument name="header" xsi:type="string" translate="true">Group</argument>
<argument name="index" xsi:type="string">customer_group</argument>
</arguments>
</block>
</referenceBlock>
</body>
</page>
This creates new empty column after column "Name". But I don't know how I can get value of "Customer Group" in this file:
\[vendor]\[module]\Model\ResourceModel\Order\Customer\Collection.php