My Account: Hide Scheduled Orders Tab

This customization is an example of how merchants can disable the Scheduled Orders tab from being shown in "My Account" when your customers visit your site. This includes a conditional, user-id based example a merchant may use to filter who can and can't view this tab.  

IMPORTANT! Always test customizations to your site on a staging environment before making changes to your live / production site.  If you are not experienced with testing changes on a staging site, here is a good article to review.

Option 1: Use CSS to Hide Scheduled Orders Tab

A developer can hide the Scheduled Order tab on the My Account page using your WordPress Customizer.

Note! Your customers will still be able to view their Scheduled Orders using the link https://yoursite.com/my-account/scheduled-orders/ even though they can not view the Scheduled Orders tab in My Account > Scheduled Orders. This is what differentiates option 1 from option 2. 

li.woocommerce-MyAccount-navigation-link.woocommerce-MyAccount-navigation-link--scheduled-orders { display: none; }

Option 2: Use WooCommerce Filter to Remove the Scheduled Order Menu Option

A developer can remove the  My Account > Scheduled Orders menu option by hooking a custom function into the 'woocommerce_account_menu_items' action.

Note! Your customers will not be able to view their Scheduled Orders using the link https://yoursite.com/my-account/scheduled-orders/ nor can they view the Scheduled Orders tab in My Account > Scheduled Orders. This is what differentiates option 2 from option 1. 

1. In the example below, a developer removes the Scheduled Orders tab from My Account for all customers. 

/* Hide Scheduled Orders tab from My Account view for all customers */ 

function remove_scheduled_order_menu_for_customers($menu_items) {
	unset($menu_items["scheduled-orders"]);<br>    
	return $menu_items;
}

add_action('woocommerce_account_menu_items', 'remove_scheduled_order_menu_for_customers', 10, 1);

2. In the example below, a developer removes the Scheduled Orders tab from  My Account based on specific customers using their Customer Id (rather than for all customers).

/* Hide Scheduled Orders tab from My Account view for a customer based on their customer id */

function remove_scheduled_order_menu_for_customers($menu_items) {	
	$customer_id = get_current_user_id();	
	if( $customer_id == 75 ){		
		unset($menu_items["scheduled-orders"]);}	
	return $menu_items;
}

add_action('woocommerce_account_menu_items', 'remove_scheduled_order_menu_for_customers', 10, 1);

Still need help? Contact Us Contact Us