0

I want to add new columns 'ID' & 'Affiliate ID' to 'Order Total Report' admin grid (REPORTS > Customers > Order Total). I am able to add these 2 columns, but only customers Id's are getting displayed & custom attribute 'Affiliate ID' value is not getting displayed.

Please check the image below

enter image description here

I have created app/code/vendor/module/view/adminhtml/layout/reports_report_customer_orders_grid.xml and added below code

                <block class="Magento\Backend\Block\Widget\Grid\Column" name="adminhtml.report.grid.columnSet.entity_id" as="entity_id">
                    <arguments>
                        <argument name="header" xsi:type="string" translate="true">ID</argument>
                        <argument name="index" xsi:type="string">entity_id</argument>
                        <argument name="type" xsi:type="string">text</argument>
                        <argument name="id" xsi:type="string">entity_id</argument>
                        <argument name="column_css_class" xsi:type="string">col-id</argument>
                        <argument name="header_css_class" xsi:type="string">col-id</argument>
                    </arguments>
                </block>
                <block class="Magento\Backend\Block\Widget\Grid\Column" name="adminhtml.report.grid.columnSet.unitee_affiliate_id" as="unitee_affiliate_id">
                    <arguments>
                        <argument name="header" xsi:type="string" translate="true">Affiliate ID</argument>
                        <argument name="index" xsi:type="string">unitee_affiliate_id</argument>
                        <argument name="type" xsi:type="string">text</argument>
                        <argument name="id" xsi:type="string">unitee_affiliate_id</argument>
                        <argument name="column_css_class" xsi:type="string">col-id</argument>
                        <argument name="header_css_class" xsi:type="string">col-id</argument>
                    </arguments>
                </block>

It's not displaying custom attribute 'Affiliate ID' value. Please tell me what shall I do so that grid will display value.

  • Only if the sales_order_grid have such column then it will display the data from there else you need prepare data source to display information in the sales order grid magento.stackexchange.com/questions/134754/… – Prathap Gunasekaran Feb 12 at 8:35
  • Thanks for reply. But I didn't understand why should I add column to sales order grid? Actually I want to add column to 'Order Total Report' grid (REPORTS > Customers > Order Total) & not to sales order grid. There are so many post discussing how to add column to sales order grid, but no one discussed about HOW TO ADD COLUMN TO 'Order Total Report' GRID. Can someone tell me how to do that? – Prince FB Feb 13 at 4:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.