Skip to content
  • RSS Feed
  • Korean
  • Japanese
WordPress Information Center
  • Home
  • Inquiry and partnership

Home » Advanced WordPress » How to display Orders instead of Woocommerce My Account Dashboard for logged in users

How to display Orders instead of Woocommerce My Account Dashboard for logged in users

July 12, 2018

When you click on the "My Account" link, you will see the Dashboard screen. It's possible to show the list of orders by clicking on the Orders tab on the left.

WooCommerce My Account page

The above screen is based on Avada theme.

If you want to display the list of orders when accessing the My Account page, you can use the following code snippet:

/* Redirects to the Orders List instead of Woocommerce My Account Dashboard */
function wpmu_woocommerce_account_redirect() {

$current_url = (isset($_SERVER['HTTPS']) ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";

$dashboard_url = get_permalink( get_option('woocommerce_myaccount_page_id'));

if(is_user_logged_in() && $dashboard_url == $current_url){
$url = get_home_url() . '/my-account/orders';
wp_redirect( $url );
exit;
}
}
add_action('template_redirect', 'wpmu_woocommerce_account_redirect');

/* Remove the Dashboard tab of the My Account Page */
function custom_my_account_menu_items( $items ) {
unset($items['dashboard']);
return $items;
}
add_filter( 'woocommerce_account_menu_items', 'custom_my_account_menu_items' );

Please enter the above code to the function file of your theme. (Please create a child theme for your current theme.)

Now you will be redirected to the Orders list when clicking on My Account.

WooCommerce My Account Orders List

Your customers will see the list of orders instead of the dashboard screen.

If you want to edit the My Account page as you wish, you can try to use the YITH WooCommerce Customize My Account Page plugin.

YITH WooCommerce Customize My Account Page: Sidebar Layout
YITH WooCommerce Customize My Account Page: Sidebar Layout
Categories Advanced WordPress
How to display the number of posts in a category in WordPress navigation menu
Sidebar not showing in WordPress Jupiter theme

Fast WordPress Web Hosting

Popular WordPress Themes

Top-selling WP Theme

Copyright(C) Designed with GeneratePress