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.
Best Answer
You cannot able to move
order_items
through layout file. Sinceorder_tab_info
block not renders it's child blocks automatically. So even though moving the blocks inside theorder_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') ?>
Now the items ordered block will be loaded before Order information.