Magento – Customize the dashboard in customer account

dashboardmagento-2.1orderswishlist

I am customizing my dashboard panel in customer account. There are two things customer info and customer address.

However when I add the order we can see orders here, but in the dashboard in the magento_customer > frontend > dashboard

There are only two .phtml files which we can be customized info and address.

  1. How I can customize the orders. Problem is orders are getting render at top but I want to render them in the last.

  2. How I can add the wish list in the my dashboard?

Best Answer

Layout file that is responsible for managing the blocks on Customer Account dashboard is customer_account_index.xml.

In Magento_Customer module, You can found this file here:

vendor/magento/module-customer/view/frontend/layout/customer_account_index.xml

In Magento_Sales module, You can found this file here:

vendor/magento/module-sales/view/frontend/layout/customer_account_index.xml

<body>
    <referenceContainer name="content">
        <block class="Magento\Sales\Block\Order\Recent" name="customer_account_dashboard_top" after="customer_account_dashboard_hello" template="order/recent.phtml"/>
    </referenceContainer>
</body>

Above is the block for responsible Recent order list. To change its position, you can change the block name to the new one where you want to show this like after info or after address.

Similar to sales module, you can create new block on Wishlist Module and add that block Content Container in customer_account_index.xml.

PS: You need to do all this modification in your current theme package.

Related Topic