Viewing 5 replies - 1 through 5 (of 5 total)
  • have you found a solution?

    I need to remove the “Complete” Button.

    Is there a hook for it?

    Plugin Contributor Mike Jolley

    (@mikejolley)

    There is no hook/capability for this action. If you can edit orders, you can change statuses (in many places).

    This worked for me:

    // Remove Order Actions button
    if ( class_exists( 'woocommerce' ) ) {
    	add_filter('woocommerce_admin_order_actions','woo_disable_complete_action');
    	function woo_disable_complete_action( $actions ){
    	    unset($actions['complete']);
    	    return $actions;
    	}
    }

    And in case user role editor is installed:

    // Remove Order Actions button
    if ( class_exists( 'woocommerce' ) && class_exists( 'User_Role_Editor' )) {
    	add_filter('woocommerce_admin_order_actions','woo_disable_complete_action');
    	function woo_disable_complete_action( $actions ){
    		if( !current_user_can('mark_order_complete') ) {
    		    unset($actions['complete']);
    		}
    	    return $actions;
    	}
    }

    Plugin Contributor Mike Jolley

    (@mikejolley)

    They can still view the order and change status there.

    yes, but I only wanted to remove that button, so no one accidentally clicks it.
    Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How to remove action buttons like "Complete" for specific user roles’ is closed to new replies.