The WooCommerce Role by Amount Spent plugin (WCRA) is a powerful tool that allows the shop admin to create “assignment rules” that dinamically assign role(s) to the customers according to the amount spent during the configured time periods. This tool can be very useful because can be use togheter with the WooCommerce Pricing! (or any 3rd party plugin) to assign dynamic prices or discounts according to the assigned roles.
HOW IT WORKSIt’s very straight-forward. Once installed and activated, a new “WooCommerce Role by Amount Spent” voice will appear in the main menu from where the shop admin can access to the “Roles and Amounts” rules configurator and create the “assignment rules”. By each rule it can be defined roles to assign according to time periods, user roles restriction, minimum amount spent (and optionally a max amount spent) and products/categories restrictions.
Every time a customer places an order or if the saves admin an order of that user or the order changes its status (using the WC_Order method or the admin area), the plugin will check if exists any rule matching the current time and amount spent. Optionallyevery rule assignment can be deferred specify another date in which the role assignemnt has to take place.ASSIGNMENT RULESUsing the Roles and Amounts Configurator menu can be created assignment rules with the following options:Rule name: used to identify the ruleTime 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 JuneTime 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 appliedTime type (if dynamic time period has been choosed): it can be minutes/hours/days/months/yearsRole(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 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.Role Re-Calculator toolBy default roles assignment rules are checked after a customer has placed an order or after an order save on admin page or after an order status update (using the WC_Order method or the admin area). If the shop admin would like to computer roles 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! NOTE:
During the computation are excluded order marked as ‘cancelled’, ‘refunded’, ‘failed’ and ‘pending’. EMBEDDED ROLE EDITORThe WCRA plugin have a inbuilt role editor that allow the shop admin to easily create new roles or delete old or inused ones. Roles can be used to assign special discountor prices using the WooCommerce Pricing! or any 3rd party plugin.Rule Assignment ExamplesWould you like to assign a special “Premium user spring 2016” role to all the customers who have spent at least 100 during spring season? it’s simple: Create a new rule and assign a name/id Time period type: Fixed Create new dates where (3): starting date: 20/03/2016 end date: 21/06/2016 Would you like to compute role assignment during a different period?: No(4) Role restriction: leave unselected Amount: 100 Max Amount: leave empty Role(s) removal: Yes (2) Role to assign: “Premium user spring 2016”(1)
Would you like to assign a special “Month premium users” role to all the customer which have spent at least 100 during the current month? Would you like to applythis special offer only for first 3 month of the year? Here you are: Create a new rule and assign a name/id Time period type: Fixed Create new dates where (3): starting date: 01/01/2016 end date: 29/06/2016 Would you like to compute role assignment during a different period?: No starting date: 01/02/2016 end date: 28/02/2016 Would you like to compute role assignment during a different period?: No starting date: 01/03/2016 end date: 31/03/2016 Would you like to compute role assignment during a different period?: No Role restriction: leave unselected Amount: 100 Max Amount: leave empty Role to assign: “Month premium users”(1)
(1) Role has to be created before creating the rule. To create a role use the Embedded Role Editor or any other 3rd party plugin.
(2) Role are assignment/removal is computed when a customer has placed an order or after an order save on admin page or after an order status update (using the WC_Order method).If none of this events take place, you have to start the roles assignment recomputation using the Roles re-calculator
at the start of the month (or whenever you whish) in order toremove the roles.
(3) Date rules with starting time greater than “now” are ignored.
(4) If setted to yes, You differ the role(s) assignment using the “spring data” to a different date. This assignment for example could be done of another season (ex: September).SCREENSHOTS
= 1.2 - 26/03/16 =* Added new feature to select product by exclusion and include categories children* Added new feature to compute role assignment in a time period different from the time period in which is computed the amount spent= 1.1 - 24/03/16 =* Improved dates configurator* Added dynamic periods= 1.0 - 20/03/16 =* Release