The WooCommerce Role-O-Matic plugin (WCRA) is a powerful tool that allows the shop admin to create “assignment rules” that dynamically assigns roles to the customers according to the amounts spent during the configured time periods or according to the purchased products. This tool can be very useful because can be used together with the WooCommerce Pricing! (or any 3rd party plugin) to assign dynamic prices or discounts according to the assigned roles.
HOW TO AUTOMATICALLY UPDATE THE PLUGIN
To receive automatic updates just install and configure the Envato updater plugin: httpss://goo.gl/pkJS33 .The official guide that explains how to configure it can be found in the following link: httpss://envato.com/market-plugin .
HOW IT WORKS
It’s very straight-forward. Once installed and activated, a new “WooCommerce Role-O-Matic” voice will appear in the main menu from where the shop admin can access to the Amounts configurator or the Products configurator menus by which the “role assignment rules” can be configured.
By the Amounts configurator can be defined rules by which roles can be assigned according to the amounts spent (excluding taxes) during the configured time periods, according to the user roles, minimum amount spent (and optionally a max amount spent) and products/categories restrictions.
Every time a customer places an order or if the shop admin saves an order or if he changes an order status (using the WC_Order method or the admin area), the plugin will check if exists any “amount role rule” matching the current time and amount spent appling it to the customer. Optionally every rule assignment can be deferred specify another date in which the role assignment has to take place.
By the Products configurator roles can be assigned according to the purchased products. Once the order is placed, to the customer will be assigned the rules associated to the purchased products. Furthermore can be also configured expiring dates, products pruchase restriction an more.
This can be very useful to manage subscription plans.
AMOUNTS CONFIGURATOR – ASSIGNMENT RULES
Using the Amounts Configurator menu can be created assignment rules with the following options:
- Rule name: used to identify the rule
- Time period type: Fixed time period(s) (You can define multiple dates) or Dynamic (To define time span like “Last 6 month” or “Last 24 hours”)
- Dates (if fixed time period(s) has been choosed): you can configure multiple date used to compute the amount and during which will be assigned the selected role(s)
- Effective computation date: This option is useful if you want to assign roles in a deffered date. For example you can use Febraury spent data to assign special roles during June
- Time range span (if dynamic time period has been choosed): The span of the time range from “now” (where now is the moment in which the user places the order) to be used for orders retrieval to compute the amount spent. During this period if a rule match is detected selected roles will be applied
- Time type (if dynamic time period has been choosed): it can be minutes/hours/days/months/years
- Role(s) restriction: You can choose to apply rule of if the customer already has one or more roles.
- Products/Categories restriction: You can choose to apply rule only if the customer has spent the desidered amount range in the selected products/categories.
- Minimum/Max Amount: these are the min/max amout spent value (excluding taxes) that the customer must spend in one of the configured period. If so, the selected role(s) (in next step) will be assigned.
- Role(s) to assign(1): Roles to assign to the customer if the amount has been spent during the configured periods.
- Role(s) removal: If an user already has one of the roles to assign but he has not spent the configured amount during the period, roles are removed.
(1)Role has to be created befor creating the rule. To create a role use the Embedded Role Editor or any other 3rd party plugin.
PRODUCTS CONFIGURATOR – ASSIGNMENT RULES
Using the Products configurator the shop admin can easily associate to products one or more user roles. Therefore customers that will buy those products will be assigned the associated role(s). This could be useful to manage subscription plans based on roles.
Optionally the shop admin can also set an expiring date that once reached will trigger the user role removal. The expiring date can be relative or fixed.
The first one is relative to the purchasing time, this mean that the expiring time could be for example 1 month later the purchase. The second one is a fixed date, like “March, 2nd 2016”.
Furthermore you can also restric products purchasing if the current customer already have the selected roles. You can also deny rebuying the products if the expiration date has not been reached.
Roles are assigned and removed automatically according to the purchasing date and expiring date. The purchasing date is the date in which the latest order (by date not by id) marked with one of the allowed statuses has been placed.
Example: if you set as allowed statuses “processing” and “completed” and if the default status when an user places an order is “payment pending”, the purchase time and roles will not be assigned until the order is marked as “processing” or “completed”.
NOTE: Changing latest order date will automatically update puchasing date for the order items that have roles associated.
You can set the allowed order statuses by the General options menu.
Expiration date extension: The plugin allows the shop admin to let customer to rebuy or not a product. In this way, in case e relative expiration date is associated to the product, after placing an order the purchase date is updated to the date the order has been placed.
SHORTCODE: To let you customer know when their products will expire you can add the [wcra_show_expiring_dates] shortcode in any page. It will display the products expiring date for the current user.
AUTOMATIC ROLE RECOMPUTATION
The plugin gives the ability to autmatic recompute roles (only for “role amount rules”) at regular time intervals. The shop admin usin the General options menu have to enable this option and choose a time span interval (ex.: every 2 hour, every 7 days, etc.) and a starting time and the plugin will recompute user role according to the existing rules!
User roles based on products are also automatic recomputed when the customer access the site.
NOTE: You can set the allowed order statuses considered during the computation by the General options menu.
ROLE RE-CALCULATOR TOOL
By default roles assignment rules are checked after a customer has placed an order, after one of its order has been edited in the admin page, after one of its order status has been update (using the WC_Order method or the admin area) or during a recomputation schedule.
If the shop admin would like to computer roles (only for “role amount rules”) without waiting, he can use the “Roles re-calculator”. He simply have to click on “Roles re-calculator” menu voice and then hit the “Recompute” button and the plugin will do the rest. That’s it!