1

I want to rearrange the sections in the sales order view (which is displayed while viewing an order in admin page).

I tried to move the Items ordered section before Order & Account Information. To achieve this, I have added sales_order_view.xml in my backend theme in Magento_Sales/layout.

<page>
    <body>
        <move element="order_items" destination="order_tab_info" before="-"/>
    </body>
</page>

However, the sales order view stays unchanged. I also tried to remove the order_items block which did work.

4

You cannot able to move order_items through layout file. Since order_tab_info block not renders it's child blocks automatically. So even though moving the blocks inside the order_tab_info block from the layout results in the same structure.

To do so, override /vendor/magento/module-sales/view/adminhtml/templates/order/view/tab/info.phtml and move the items ordered block before Line no:19 <?php echo $block->getChildHtml('order_info') ?>

<section class="admin__page-section">
    <div class="admin__page-section-title">
        <span class="title"><?php /* @escapeNotVerified */ echo __('Items Ordered') ?></span>
    </div>
    <?php echo $block->getItemsHtml() ?>
</section>

Now the items ordered block will be loaded before Order information.

  • 1
    Thank you very much for your help! I'd hoped that there would be a possibility via the layout file. I think in this case Magento is very inconsistent.Especially because I have to change two phtml files to be able to change the order for this single page. – FaHu Jul 14 '17 at 6:57

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.