I have a strange requirement from the client. I want to remove dashboard text. Instead,dashboard text I want to show the order details when my account pages load.
ie /my-account/
shows the order details(content of /my-account/orders
).
I tried some wp-redirection, but its won't work.
This is a pretty old question, but as I was just trying to solve the same problem figured I may as well share my solution. I did 3 things to accomplish this problem:
woocommerce/account/dashboard.php
template into my local theme and remove all the content. Originally I would have rather automatically redirected away from this page, but at least this way the user doesn't see the "Hello Bob" text. It's also nice to keep this page for the logout confirmation message.function WOO_login_redirect( $redirect, $user ) {
$redirect_page_id = url_to_postid( $redirect );
$checkout_page_id = wc_get_page_id( 'checkout' );
if ($redirect_page_id == $checkout_page_id) {
return $redirect;
}
return get_permalink(get_option('woocommerce_myaccount_page_id')) . 'orders/';
}
add_action('woocommerce_login_redirect', 'WOO_login_redirect', 10, 2);
function WOO_account_menu_items($items) {
unset($items['dashboard']);
return $items;
}
add_filter ('woocommerce_account_menu_items', 'WOO_account_menu_items');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With