Hello @thebusinesscat
Is the user that you logged in created by the plugin or a normal admin user?
Hi @waseem_senjer
Thank you for your message.
I am just a standard admin user created by WordPress.
There is another admin that is also having the issue, and he has the standard admin role and WooCommerce customer role.
Just to let you know that there is a new user role created called chairperson, and this is done with some code, which I will put below, however, I nor the other admin has this user role set.
function add_egha_chairperson_role() {
// Add the custom role with read-only capabilities
$role = 'chairperson';
$display_name = 'Chairperson';
$capabilities = array(
'read' => true
);
add_role($role, $display_name, $capabilities);
}
add_action('init', 'add_egha_chairperson_role');
// Assign Chairperson role to specific ID's
$egha_chairperson_user_ids = array( 552, 554, 593, 604, 605, 606, 607, 608, 609, 610, 615, 887);
foreach ( $egha_chairperson_user_ids as $user_id ) {
$user = new WP_User( $user_id );
$user->add_role( 'chairperson' );
}
// Add customer role to Chairperson after purchase
function add_customer_role_to_chairperson( $order_id ) {
$order = new WC_Order( $order_id );
$user_id = $order->get_user_id();
$user = new WP_User( $user_id );
if ( in_array( 'chairperson', (array) $user->roles ) ) {
$user->add_role( 'customer' );
}
}
add_action( 'woocommerce_new_order', 'add_customer_role_to_chairperson' );
Thank you.
Hello @thebusinesscat
Thanks for the info. Please, update the plugin to the latest version 2.0.12 it should fix the issue. Please let me know if you have any other issues, I will be glad to help.