Roles Assignment Logic

Overview

Since Ultimate Member - Woocommerce 2.2.3 version there is new roles assignment logic, which is more clear and flexible with changing order statuses, refund, or payment completes.

Global settings for orders

Ultimate Member - Woocommerce allows you to set different roles after order status changed to complete/refund. You could find these settings in the Ultimate Member > Settings > Extensions > Woocommerce screen

  • Ignore the roles update, if the user has these roles on complete/processing or refund payment - users who have one of the selected roles will be ignored when changing the order status.
  • Assign this role to users when an order is completed/processing - automatically add the selected role to the user when order is completed or processing (for digital/downloadable products).
  • Upgrade user role when payment is on-hold before complete or processing status - add the selected role above to the user when the order has on-hold status. It just will set the role earlier than completed or processing status.
  • Assign this role to users when an order is refunded - automatically add the selected role to the user when the order is refunded. Please pay attention that this option works only for fully refunded orders. It doesn't work for a partial refund.
  • Remove previous roles when change role on complete/processing or refund payment - when "yes" allows to remove all current roles for the user and set only that roles, which are selected in the options above.
  • Disable subscriptions roles switcher - by default, there can be a conflict between WC Subscriptions plugin options and roles assignment by Ultimate Member - Woocommerce integration for subscription products. Please leave checked to avoid the conflict.

The role data is stored in the order meta. This means that when you change the role in the setting for old purchases, the old setting will apply.

Individual product settings

The extension allows you to set different roles for the product buyers and remove this role after a product refund. You could find these settings in the WooCommerce Product Add/Edit screen

  • When this product is bought move the user to this role - this role will be assigned to the user when an order with this product is completed/processing and will be removed when this product is refunded.

The extension saves a product settings on purchase and uses saved settings to change a role when the order status is changed. Changing a product setting influences future orders but doesn't influence existing orders.

Individual product settings for subscriptions

Ultimate Member - Woocommerce allows you to set different roles for the subscription product buyers and remove/change this role when subscription status is changed. You could find these settings in the Woocommerce Product Add/Edit screen.

  • When subscription is {subscription_status} move user to this role - this role will be assigned to the user when the subscription's status is changed to {subscription_status}.

The extension saves a product-subscription settings on purchase and uses saved settings to change a role when the subscription status is changed. Changing a product-subscription setting influences future subscriptions but doesn't influence existing subscriptions.

The extension changes the user role when subscription status is changed in this way:

  • a role selected for the previous subscription status is removed;
  • a role selected for the current subscription status is added;
  • all other roles are kept as they are.

There are several cases when the extension doesn't change the user role:

  1. if the current user role is selected in the setting "Ignore the roles update, if the user has these roles on complete/processing or refund payment".
  2. if the role selected for a new subscription status is the same as the current user role.
  3. if the role selected for a new subscription status is the same as the role selected for the previous subscription status.

Note: WordPress users may have multiple roles, this not an issue. Ultimate Member uses settings from the user role with the highest priority. Use role setting "Role Priority" to solve role conflicts.