Roles Archives - Plugin Republic https://pluginrepublic.com/support-categories/roles/ WooCommerce Plugins Tue, 06 Apr 2021 06:54:34 +0000 en-US hourly 1 https://pluginrepublic.com/wp-content/uploads/2020/10/cropped-favicon-1-32x32.png Roles Archives - Plugin Republic https://pluginrepublic.com/support-categories/roles/ 32 32 Remove existing user roles https://pluginrepublic.com/documentation/remove-existing-user-roles/ https://pluginrepublic.com/documentation/remove-existing-user-roles/#respond Thu, 25 Jun 2020 05:44:42 +0000 https://pluginrepublic.com/?post_type=ht_kb&p=479366 You can use the following filter to remove existing user roles if a user is assigned a new role when purchasing a product: This is how to add a snippet.

The post Remove existing user roles appeared first on Plugin Republic.

]]>
You can use the following filter to remove existing user roles if a user is assigned a new role when purchasing a product:

View this code snippet on GitHub.

This is how to add a snippet.

The post Remove existing user roles appeared first on Plugin Republic.

]]>
https://pluginrepublic.com/documentation/remove-existing-user-roles/feed/ 0
Add new user role when existing role expires https://pluginrepublic.com/documentation/add-new-user-role-when-existing-role-expires/ https://pluginrepublic.com/documentation/add-new-user-role-when-existing-role-expires/#respond Tue, 09 Jun 2020 10:45:58 +0000 https://pluginrepublic.com/?post_type=ht_kb&p=445780 If you are setting an expiry time on membership roles, you might want to add a new role when the membership role expires. You can do this with the following snippet. Note that if you are assigning a new role to replace an expired role, you will need to have created that new role in […]

The post Add new user role when existing role expires appeared first on Plugin Republic.

]]>
If you are setting an expiry time on membership roles, you might want to add a new role when the membership role expires.

You can do this with the following snippet. Note that if you are assigning a new role to replace an expired role, you will need to have created that new role in WooCommerce > Settings > Members Only > Roles.

View this code snippet on GitHub.

Here’s how to add a snippet.

The post Add new user role when existing role expires appeared first on Plugin Republic.

]]>
https://pluginrepublic.com/documentation/add-new-user-role-when-existing-role-expires/feed/ 0
Create new user roles https://pluginrepublic.com/documentation/create-new-user-roles/ https://pluginrepublic.com/documentation/create-new-user-roles/#respond Wed, 05 Feb 2020 07:32:47 +0000 https://pluginrepublic.com/?post_type=ht_kb&p=243644 You can create a new user role by following these steps: Go to WooCommerce > Settings > Members Only > User Roles In the ‘User roles’ field, select an existing user role to duplicate (e.g. Subscriber) Enter the name of your new role in the ‘New role name’ field Click the ‘Duplicate role’ button

The post Create new user roles appeared first on Plugin Republic.

]]>
You can create a new user role by following these steps:

  1. Go to WooCommerce > Settings > Members Only > User Roles
  2. In the ‘User roles’ field, select an existing user role to duplicate (e.g. Subscriber)
  3. Enter the name of your new role in the ‘New role name’ field
  4. Click the ‘Duplicate role’ button

The post Create new user roles appeared first on Plugin Republic.

]]>
https://pluginrepublic.com/documentation/create-new-user-roles/feed/ 0
Restrict or allow shipping methods by user role https://pluginrepublic.com/documentation/restrict-or-allow-shipping-methods-by-user-role/ https://pluginrepublic.com/documentation/restrict-or-allow-shipping-methods-by-user-role/#respond Mon, 27 Jan 2020 14:53:22 +0000 https://pluginrepublic.com/?post_type=ht_kb&p=233006 You can choose to restrict or enable shipping methods by user roles. In WooCommerce > Settings > Members Only > Shipping Methods, you’ll see a list of all the shipping methods enabled on your site. Under each shipping method, there’s a field for ‘Restricted roles’ and a field for ‘Permitted roles’. If you want to […]

The post Restrict or allow shipping methods by user role appeared first on Plugin Republic.

]]>
You can choose to restrict or enable shipping methods by user roles. In WooCommerce > Settings > Members Only > Shipping Methods, you’ll see a list of all the shipping methods enabled on your site.

Under each shipping method, there’s a field for ‘Restricted roles’ and a field for ‘Permitted roles’.

Shipping methods by user role

If you want to prevent users with specific roles from using a certain shipping method, enter the roles in the ‘Restricted roles’ field.

If, on the other hand, you want to enable the shipping method for certain roles, enter those roles in the ‘Permitted roles’ field.

You can also add a filter to ignore any non-logged-in users from these rules:

View this code snippet on GitHub.

The post Restrict or allow shipping methods by user role appeared first on Plugin Republic.

]]>
https://pluginrepublic.com/documentation/restrict-or-allow-shipping-methods-by-user-role/feed/ 0
Set expiration dates on membership products https://pluginrepublic.com/documentation/set-expiration-dates-on-membership-products/ https://pluginrepublic.com/documentation/set-expiration-dates-on-membership-products/#respond Sat, 25 Jan 2020 13:37:10 +0000 https://pluginrepublic.com/?post_type=ht_kb&p=230744 If you are assigning user roles to customers who buy certain products, you might want to set an expiry date for the user roles. So, after a specific time, the role will be automatically removed from the user (unless they purchase the product again). To do this, edit your product and click on the ‘Members […]

The post Set expiration dates on membership products appeared first on Plugin Republic.

]]>
If you are assigning user roles to customers who buy certain products, you might want to set an expiry date for the user roles. So, after a specific time, the role will be automatically removed from the user (unless they purchase the product again).

To do this, edit your product and click on the ‘Members Only’ tab. In the ‘Expires After’ field, set the duration of the roles in either days, weeks, months or years.

The post Set expiration dates on membership products appeared first on Plugin Republic.

]]>
https://pluginrepublic.com/documentation/set-expiration-dates-on-membership-products/feed/ 0
Set user role after purchasing a product https://pluginrepublic.com/documentation/set-user-role-after-purchasing-a-product/ https://pluginrepublic.com/documentation/set-user-role-after-purchasing-a-product/#respond Sat, 25 Jan 2020 13:34:28 +0000 https://pluginrepublic.com/?post_type=ht_kb&p=230742 You can automatically assign user roles to customers when they buy certain products. For example, if you are selling memberships to your site, you can create a ‘Gold Member’ product that assigns the ‘Gold Membership’ user role to anyone who purchases it. For guidance on setting user roles after purchasing a product, take a look […]

The post Set user role after purchasing a product appeared first on Plugin Republic.

]]>
You can automatically assign user roles to customers when they buy certain products. For example, if you are selling memberships to your site, you can create a ‘Gold Member’ product that assigns the ‘Gold Membership’ user role to anyone who purchases it.

For guidance on setting user roles after purchasing a product, take a look at this article.

Assigning roles on order completed

By default, the new role will be assigned to the user when their order status changes to ‘Processing’. This ensures that users don’t get their new roles too soon.

However, some orders might skip the ‘Processing’ status, e.g. orders containing downloadable products. In this case, you can set the status where roles are assigned to ‘Completed’.

To do this, go to WooCommerce > Settings > Members Only > Registration and choose ‘Order Completed’ from the ‘Assign Roles Order Status’ field.

WooCommerce assign roles order status

The post Set user role after purchasing a product appeared first on Plugin Republic.

]]>
https://pluginrepublic.com/documentation/set-user-role-after-purchasing-a-product/feed/ 0
Restrict or allow payment gateways by user role https://pluginrepublic.com/documentation/restrict-or-allow-payment-gateways-by-user-role/ https://pluginrepublic.com/documentation/restrict-or-allow-payment-gateways-by-user-role/#respond Sat, 25 Jan 2020 11:52:58 +0000 https://pluginrepublic.com/?post_type=ht_kb&p=230717 You can choose to restrict certain payment gateways to specific user roles. In WooCommerce > Settings > Members Only > Payment Methods, you’ll see a list of all the payment methods enabled on your site. Under each payment method, there’s a field for ‘Restricted roles’ and a field for ‘Permitted roles’. If you want to […]

The post Restrict or allow payment gateways by user role appeared first on Plugin Republic.

]]>
You can choose to restrict certain payment gateways to specific user roles. In WooCommerce > Settings > Members Only > Payment Methods, you’ll see a list of all the payment methods enabled on your site.

Under each payment method, there’s a field for ‘Restricted roles’ and a field for ‘Permitted roles’.

If you want to prevent users with specific roles from using a certain payment method, enter the roles in the ‘Restricted roles’ field.

If, on the other hand, you want to enable the payment method for certain roles, enter those roles in the ‘Permitted roles’ field.

Payment gateway filters for non-logged-in users

By default, payment gateway rules will always assume that non-logged-in users don’t have the correct role, whatever the rule.

You can apply one of the filters below to change this behaviour:

  • wcmo_ignore_payments_for_non_logged_in
    Use this filter to ignore all role-based payment gateway rules for non-logged-in users
  • wcmo_ignore_permitted_payments_for_non_logged_in
    Use this filter to include non-logged-in users in ‘Permitted’ payment gateway rules
  • wcmo_ignore_restricted_payments_for_non_logged_in
    Use this filter to exclude non-logged-in users from ‘Restricted’ payment gateway rules
View this code snippet on GitHub.

Here’s how to add a snippet.

The post Restrict or allow payment gateways by user role appeared first on Plugin Republic.

]]>
https://pluginrepublic.com/documentation/restrict-or-allow-payment-gateways-by-user-role/feed/ 0