Wednesday, October 21, 2020

Woocommerce: My Account Page -> Remove "Dashboard" Tab

Redirect the Dashboard page to Orders Page like Walmart 

// -------------------------------

// Redirect initial login straight away to orders page like Walmart

// 

add_action('template_redirect', 'redirect_to_orders_from_dashboard' );

 

function redirect_to_orders_from_dashboard(){

 

if( is_account_page() && empty( WC()->query->get_current_endpoint() ) ){

wp_safe_redirect( wc_get_account_endpoint_url( 'orders' ) );

exit;

}

 

}



This works but unable to use with with RMA plugin as it looks for dashboard to load. 

No comments: