Skip to content

Backport to 2.2 of #10824: add name for order items grid default renderer block #11076

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 29, 2017

Conversation

gsomoza
Copy link

@gsomoza gsomoza commented Sep 26, 2017

Backport to 2.2 of #10824

Description

Add name for default renderer block of order items to allow other modules reference it.

Fixed Issues (if relevant)

  1. Cannot add new columns to item grid in admin sales_order_view layout #10824: Cannot add new columns to item grid in admin sales_order_view layout

Manual testing scenarios

  1. In custom module create file view/adminhtml/layout/sales_order_view.xml with the following content
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="order_items">
            <arguments>
                <argument name="columns" xsi:type="array">
                    <item name="test_column" xsi:type="string" translate="true">Test Header</item>
                </argument>
            </arguments>
            <referenceBlock name="default_order_items_renderer">
                <arguments>
                    <argument name="columns" xsi:type="array">
                        <item name="test_column" xsi:type="string" translate="true">col-test</item>
                    </argument>
                </arguments>
            </referenceBlock>

            <block class="Magento\Sales\Block\Adminhtml\Items\Column\DefaultColumn"
                   name="column_test_column"
                   template="Vendor_Module::test.phtml" group="column" />
        </referenceBlock>
    </body>
</page>
  1. create file view/adminhtml/templates/test.phtml file with content
Test column
  1. Go to the order view page.

  2. Column with header "Test Header" is shown with content "Test column"

Contribution checklist

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)

@pptyasar
Copy link

How to make as first column in table @gsomoza

@ask694
Copy link

ask694 commented May 2, 2019

@pptyasar did you got the answer for making as first column.? please share the solution here

@VadimLugovoy
Copy link

Did somebody found a solution to change position of this column?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants