hi @miguelonx ,
I don’t think there is option for that. You have to get your hands dirty and code your way through that.
Hi, nothing to hard code.
In your WordPress Dashboard go to Settings, click the first Submenu (in my German version its “allgemein”, so maybe in english it is common or something similar) and ther you can find an dropdown standard role of new user. Change it to you likings. By default if woo is installed it is customer.
Hi @vaibhav26 ,
Do you know of any code that might work for what I need?
Thanks,
-
This reply was modified 3 years, 1 month ago by
Miguelonx.
Hi there,
You may use the following filter to create WooCommerce users with a “Subscriber” role.
This code can be added yo your website using a plugin such as Code snippets.
add_filter( 'woocommerce_new_customer_data', 'woocommerce_new_customer_data_set_role' );
/**
* Function for woocommerce_new_customer_data filter hook.
*
* @param array $customer_data An array of customer data.
*
* @return array
*/
function woocommerce_new_customer_data_set_role( $customer_data ){
$customer_data['role'] = 'subscriber';
return $customer_data;
}
Note: Roles are used to determine what type of access a user should have across the website. Changing a user role may impact their experience with WooCommerce and/or third-party plugins. Test this on a staging site before applying the code to a production environment.
Hi @ricardoa8c !
Thanks for you reply.
I will try the code you send me to see if I can solve my problem.
Best regards!