207 comments found.
Hello, this is me from above through the account that made the purchase.
So, again, “I just need to find where the actual writing of the new roles to the capabilities user meta happens so I can replicate it to the other sites’ capabilities either by hook or hack. I guess that it’s at the update_user_role_by_product_role_rule function at WCRA_Customer.php – can support confirm or deny that?”
Thanks!
Hello,
Thank you for using the proper account and supporting my work thought the purchase.
Yes, you’re right. The user roles are added through the update_user_role_by_product_role_rule () method defined in the classes\com\WCRA_Customer.php file.
Roles are instead removed by invoking the remove_user_roles() and remove_all_roles() methods.
at last, the default role is eventually restored through the set_default_role_if_necessary() mehotd.
Hello, I just purchased WC Role-O-Matic for a customer using their account. It works perfect out of the box but they have a special requirement.
They have a multisite set up with a shop in the main site and a private area in the subsite. A purchase changes the user role correctly at the main site, but they also need it changed at their subsite.
I can sync roles via another plugin, but their site is cluttered already and I would prefer to modify Role-O-Matic if possible. Any advice on where I should start? BTW thanks for your extensively annotated code, a real pleasure to read.
Hell,
I’m really sorry, but the support service doesn’t include any customization service. Furthermore what you ask cannot be eventually suggested using just few lines here in the comment system.
Yeah I KNOW what support includes, I was not asking you to do my job, just for some guidance so I don’t need to go through every single file included.
I just need to find where the actual writing of the new roles to the capabilities user meta happens so I can replicate it to the other sites’ capabilities either by hook or hack. I guess that it’s at the update_user_role_by_product_role_rule function at WCRA_Customer.php – can support confirm or deny that?
I’m sorry, for that kind of information, you need posting the question using an account with a valid purchase and support licenses associated with it.
Hi, I bought the plugin as I have Agents that I need to move from one to level to the next depending on their total purchases.
I want the plugin to calculate for the entire month what the role spent and then move them to a different role only (not after every order).
Also the plugin has a minimum spent and if they spend more than that then it moves up – what if they spend less than that amount ? I need to set it for if they do not spend a certain amount then it moves them.
I want all my rules set up before hand to calculate orders for a month and then move the different roles to other roles accordingly. Can this be done ?
- The plugin is not designed to work that way. You can eventully try editing the WCRA_order.php file located in the classes\com folder and comment line 14 and 15. Once donce, roles will be recoputed/assigned only when you manually operform the Roles re-calculator
- If the amount spent doens’t mach the amount, the plugin, by default, doesn’t perform any action. In alternative you can use the option to remove the assigned roles via the Roles removal option: https://nimb.ws/uWxfKC
I have tried that, but the plugin is calculating on order and not for the month’s totals and then removing my agent. I need it to check the Agent’s orders for the entire month and then only do the switch. I think I might have understood this plugin to do something different to what I need. What is your refund policy ?
The plugin has a detailed description page where its features are reported. It also has a demo site where its features can be fully tested before purchasing in order to be sure it actually needs as the user needs and expects.
Once purchased, the Envato refund policy won’t grant a refund because the software is not working as it never claimed to or because the user had in mind something different from what was advertised. Otherwise, any user could use such argumentation, get the money back and continue using the software for free.
I understand and did check all of that, bit misleading though as your plugin states amounts calculator (which is what I need), but it does not work the way I thought. It is not however Envato that states the refund policy it is you yourself as I know for a fact that a refund may be granted from the Author.
Please change the way the plugin is presented showing the amounts calculations as that makes it become a bit misleading.
I think in future for anyone using a plugin from they should only look at those who state that they are prepared to give refunds if not happy.
We as normal users do not write these plugins and therefore cannot possibly know the nitty gritty behind them and therefore go on what we think is correct based on your images etc. I did look at the demo, but as I did not have my full month’s sales etc on there it was almost impossible to know that it would not work.
I will give a review shortly – thank you
The plugin works as advertised. Regarding the amount calculator: https://nimb.ws/TgMrRv It assigns one or more roles according to the amount spent, amounts spent that can fall in a selected time period that can be easily configurable via the amounts configurator menu: https://nimb.ws/TgMrRv The recomputation of the roles according to the existing pricing rules places every time the user places an order, when an order is modified via the admin area or when the admin performs a manual role recomputation via the special menu.
The product description page must be carefully read before any purchase. The plugin demo site has been setup precisely to avoid this kind of scenario.
The user, before any purchase, should be using it to create its scenarios and be sure the software actually fits his needs and expectations.
The user, eventually, in case of further doubts, can ask presale questions.
Software is not like physical products. Once purchased, they cannot be returned. This is why the user is provided before any purchase, all the info, and tools in order to be sure of what he is purchasing.
That’s it, if the user bought without even caring to read the description or performing any test, the author or Envato cannot be blamed. You must take responsibility.
For authors and Envato, once the software is purchased, it is not possible to determine if the user is stating is true and cannot prevent continuing to use the software in any way. This is why the policy won’t grant this kind of scenario.
Hi First of all thank you for your work, your plugin is exactly what I was looking for, however I encounter some problems. I’m looking to offer memberships to my visitors, so I created three sheets produced in Woocommerce that correspond to different membership plans, each of them corresponds to a different role, so I configured three rules in the plugin in the product configurator. -The first deletes the current role and assigns the “adhérent” role for 12 months when a user purchases the “adhérent” product, and at the end of these 12 months the “adhérent” role is deleted and replaced by the “customer” role . -The second deletes the current role and assigns the “contributeur” role for 12 months when a user purchases the “contributeur” product, and after these 12 months the “contributeur” role is deleted and replaced by the “customer” role . -The third deletes the current role and assigns the “bienfaiteur” role for 12 months when a user purchases the “bienfaiteur” product, and at the end of these 12 months the “bienfaiteur” role is deleted and replaced by the “customer” role . The problem is that only the first rule works, the other two rules are ignored even if I temporarily disable the first and the last, the second does not work and the same for the third, only the first works while the settings are the same! ?
Have you ever been told this kind of problem, can you help me? If needed I can provide you with access to the backend to see for yourself. Here is a video to illustrate my problem (I just changed the period from 12 months to 5 minutes for testing): https://youtu.be/Px5VpubG35o
Thanks in advance
Hi,
thank you for reporting the issue and the step-by-step guide on how to experience it.
It was related to the “Rule application policy” option. I’ve fixed it and released the new 8.9 that will address it.
The update will be available to download in a few minutes (the Envato approval process takes a while to approve updates).
You can manually download the new version via CodeCanyon or receive an automatic update by installing and configuring the Envato updater plugin: https://goo.gl/pkJS33 (here is the guide that explains how to configure: https://envato.com/market-plugin/ ).
To manually update: deactivate, delete the old plugin and just install the new one! Don’t worry, you won’t lose any data! 
Give it a try and let me know!
Great! this fixed the problem! Thank you for the speed and efficiency of your help.
yes! very glad to hear that! 
At last but not least, I would ask you to help me: If you enjoyed my efforts to assist you and/or my plugin please consider leaving the 5 stars…It would help me with sales, I would reeeeeally appreciate it! 
(to leave a rating: go to your profile page, click on “Downloads” and from there you can rate your purchases.
You can also leave the rating through the plugin description page: https://www.dropbox.com/s/v6zaoe0p6cs4x2o/rating.png?dl=0 )
Hi!
Please remember the rating, it would help me a lot ad I would greatly appreciate it! 
Hello,
I installed the plugin and created the role rules unfortunately when I try to recalculate it does not work.
Thanks,
Alex
Hello,
I’m sorry, but without any further clue, it is quite hard to determine the cause. It could depend on a misconfiguration, a 3rd party interference, and several other causes.
First of all, could you provide a more detailed description of the issue? In order to exclude any interference (3rd party or server issues) please use the following installation: https://codecanyondemo.work/wcra/wp-admin/ (user: admin, pass: admin) to recreate your scenario and report to me if you are still experiencing the issue. If so, please report me a step-by-step guide on how to. Thank you.
Hi Vanquish, I would like to give some comments on the plugin calculation part.
Currently, I found that the role calculation (I tested amount config only) is triggered when:- an order is placed;
- the order status is changed to the one not excluded in general option.
- the trigger: set calculation processes to be triggered whenever there is an order status changed or the order is move to trash or un-removed, so it will calculate the updated user amounts.
- calculate amounts: allow to set exclusion of the “amount” from specific order status. e.g. When order is refunded, the refunded amount will be deducted from role upgrade amount.
- user calculation: limited the calculation only on specific users who’s order is placed, status is changed, so that the calculation will not calculation ALL users every time that leads to heavy server loading.
Understood that this is a big part, so I just want to provide some ideas/workflows because I found that the plugin sometimes doesnt perform calculation, especially when an order is placed by Bank transfer, received money that changed to processing and then refund for some reasons. The calculation triggers and calculation logic seem not clear.
Wish your plugin can be more perfect as there’s no such plugin like yours.
Hi,
thank you for your suggestions!
However, actually the calculation is already triggered whenever an order is changed. You can give a look to the WCRA_Order.php file located in the classes\com folder.
As you can see at line 9, the plugin hooks to the woocommerce_order_status_changed action (triggered by WooCommerce when an order changes status). The handler is defined at line 24. It forces the computation of the roles of the users associated to that order. The recomputation considers only the order that match the selected order statuses (set globally: https://nimb.ws/9uVWNj).
Make eventually sure to enable the “Role(s) removal if amount spent doesn’t match” option: https://nimb.ws/LKMZGn
I’ll perform some further tests for the scenario you reported to have more clues for the issue you are experiencing!
Please try updating to the latest 8.8 version, it should fix the issue you experiencing when trashing or refunding an order!
Thanks a lot vanquish for the update of trashing order or refund order!
Hello,
Is it possible to track role changes through a report or log?
Best regards,
Dada staff
Hello,
I’m sorry, the plugin hasn’t such a feature
Can you recommend a plugin that tracks role changes dynamically (last 3 months, last 6 months <- important! , last year)?
I’m really sorry I don’t know any plugin that performs that 
Hi, I would like to give some advice after using for a couple of periods:
1) About Customer email notification: - Email works fine when member upgraded - While if member is downgraded, there’s no email for it. - It would be highly appreciated if there is an email notification for customer.
2) About Recalculate user roles - Situation 1 (order 1): I found that if an order is dropped into the trash, the customer will still keep the current role. - Also, if there’s an order 2 changes status, the situation 1 remains unchanged too.
- Yes, if yow know which action/filter the subscription plugin triggers when an user downgrade, I can try to extend the plugin
- Abou the trashed order, thank you for reporting. I’ll fix in the next release Thank you for your report!
Hi,
1) Well… thats hard for me to do with coding. Maybe I can provide my mindset for it. For example, I found the Woo Doc has an action “woocommerce_subscriptions_updated_users_role”.
Is it possible to add variable into the email template? Eg, Congratulations! You are changed from {{old-role}} to {{new-roles}}. That calls the user role name. Email is triggered while the user role is changed. XD hope it helps. =)
2) Thank you very much for your help.
- I’m sorry, but I do not find any documentation on the web for the ‘woocommerce_subscriptions_updated_users_role’ hook. Could you share some links?
- For now it is not possible. Thank you, however, for your suggestion! I’ll try to include that enhancement in a future plugin release!
2) Thanks anyway!
- thank you for reporting. Unfortunately, the ‘woocommerce_subscriptions_updated_users_role’ is triggered when the subscription is activated, suspended, canceled, or expired. So it is not possible to detect if the user is upgraded or downgraded. I’ll however try to investigate further
- Please update to the latest 8.7 version. It now allows you to use the [removed_roles] and [added_roles] shortcodes!
Great thanks to you!!
Hi Vanquish,
1) I finally had tested the shortcode in email section. However, [removed_roles] and [added_roles] shortcodes will return message: No roles have been removed & No roles have been added in the notification email. Quite strange.
Kind reminder: I can see your changelog on codecanyon, but the documentation or item page doesnt include you updates, like shortcode. It may confuse the new customers. =)
Thank you for reporting! From my tests all seems working fine, I’ll perform further analysis!
No problem =)
What is the current version for WooCommerce Role-O-Matic ? I have Version 4.9 and I’m getting an error.
The latest is 8.4
Hi, I justo bought the plugin, but is not showing at the menu for configurations, can you help me? Thanks
Hi, please make sure you are using a full admin account to access the admin area. Make also sure that there is no 3rd party plugin interfering: try disabling all of them and reperform a test. If you are not experiencing the issue, re-enable one by one until you find the interfering one. Once done, report to its developer in order to fix the interference.
Hello, no, isn´t working… do you have a refund policy?
As you can test in the demo site, in a fully working environment the Plugin works without any issue. So it is quite strange that isn’t working despite the steps I’ve asked you to perform in order to identify the cause.
The Envato refund policy won’t grant a refund due to 3rd party plugin interferences. You should ask for a refund for the plugin that is causing the malfunction. Authors are not held responsible for 3rd party issues.
Hi, can you tell me if this is compatible with the free WCFM plugin? I’m looking to set up franchises, so automatic roles need to be total spent globally – not just at one franchise. Also, products and prices are set only by admin which vendors can sell. Thank you.
Hi,
I’m sorry but the plugin hasn’t any particular support for that plugin.
Is it compatible with any other multi-vendor plugin?
I’m sorry, It hasn’t actaully tested with any muti vendor plugin.
Will roles re-calculator also remove roles from users that already have a role that should be expired?
Yes, the roles will be removed according the “role-per-amount” spent period and according to the “expired” options.
The plugin has a demo site where you can fully tests its features. Give a try to be sure it actually fits your need before any purchase!
Hi,
I created a rule so that roles A and B are assigned when a user purchases a specific product, using “role per product” rules.
The roles are correctly assigned. However, I set the expiration role A to be assigned after the order expires (as I want users to stop having role
, and this is not working at all and creating support tickets constantly. All roles are removed and the expiration role A is not assigned.
These are the settings:
- Roles to assign when purchase: A and B - Expiring date type: relative - time value: 12 months - roles to assign after expiring date: A - remove all roles before assig expiring date role(s): yes
When the 12 months expire, both roles A and B are removed and the user remains with the default wordpress role, not with role A assigned. What should I change to make this work? I need to solve this as soon as possible.
Thanks.
**as I want users to stop having role B (the text field turned it into an emoji)
Hi,
If you want to leave the role A, just try setting in the expiration as “Remove all roles before assign expring date role” the “Selected ones” option and then just select the B role.
Hi. Thanks for the reply. I will test this way and see if the issue appears again.
You’re welcome 
Good Morning,
I just installed your plugin and everything seems to work perfectly. I only have one problem in terms of sending email notification, and that is that the same email is being sent twice. What could it be? Regards!
Hi,
unfortunately, without any further clue, it is quite hard to determine the cause 
To which email notification are you specifically referring? Could you try disabling all the other 3rd party plugin, reperform a test, and report to me if you are still experiencing the issue?
Hello!
1. Tell me, in the account of the client the Since field: 08/27/2018 – 15:42 shows the current time, but not the start date from which the countdown occurs. (on my system, I use a dynamic period of 2 years, since my goal is to change the user’s role if the client has bought 200,000 in total in the last 2 years from today). Do I understand correctly that it is systematic to show the start date of this program, i.e. date 2 years ago from today’s date is not possible? Is it possible to add a field so that the customer can see how many days they have left before the role change and demotion in order to encourage them to buy faster?
2. Role list title – can you place an image next to it? (in my system, each role is a certain conditions for discounts and it would be nice to assign a visual element to each role in the form of a discount card, for example?) Can you advise something? or php to display an image for each role change?
3. I have a problem with the wc marketplace plugin. It duplicates “Total Spent:” (since the order is executed by me and duplicated by the vendor and for order 1000, Total Spent: is defined as 2000). Is there a way to solve this somehow?
Thank you, great plugin!
- The since fields report the start date of the rule. So if you configured a dynamic time span, for example, two years from now, it will show the today date minus two years (so 08/27/2018).
The end date will be shown only in case you configure a fixed time span, in that case, the user will know exactly when the period will end. In case of dynamic (like yours), there isn’t a fixed end because the rule is always active, so it cannot be shown an end date - You can edit the next_roles_list.php file you find in the templates folder inside the plugin and customize the code inserting the visual effect you wish
- You should contact that plugin developer in order to avoid the order duplication, or at least make sure it is not assigned twice to the customer (in this way the Role-O-Matic plugin will be able to properly compute the total spent)
Hi, thanks for your answer. To understand the situation, I am sending you a screenshot of how the WC Marketplace Supplier Enhancement Plugin creates a suborder for each supplier, that suborder and doubles the result. I contacted the developer of the WC Marketplace plugin that creates an additional order. To fix this, I need to ask you: how does your plugin receive the order and the details for calculating the total spent? Once WC Marketplace gets this process, they can help me out and exclude the sub-order from it.
https://priscree.ru/img/a536f6955b8c50.jpg https://priscree.ru/img/d6f8dc6fe4fb1d.jpg *sub-orders are marked by the vendor, and as soon as the status changes to “completed” a double appears. I hope for your help. Thank.Hi,
the plugin retrieve the orders using a SQL query. You can see it by editing the WCRA_Order.php file you find in the classes\com folder inside the plugin.
The function is the get_orders_by_date_and_user_id() defined on line 63. That function retrieve all the order associated to the user in a specific time span. The result of that function will be used by another subcomponent to filter the orders according the amount spent.
Hello! I still have my problem, I contacted the developers of the WC Marketplace plugin, with the problem of duplicate sales result due to suborders (for the vendor are created for the main order) and I was recommended to contact you again. I will provide the answer from WC Marketplace developer: “Hi, we reviewed the role o matic plugin and your issue. To resolve your issue we need to just exclude the suborders from the places where your order price gets doubled. Since we can’t edit in the core file, so you need to ask the role o matic plugins team for hook/filter or any way out so we will able to exclude the suborders from the places where your order price gets doubled.Please, can you do this? I am confused” https://wc-marketplace.com/support-forum/topic/duplicate-balance-spent-total-in-plugin-role-o-matic-in-reports-woocommerce/#post-105268
Please, can you do this? I am confused… Thanks you
Hello,
thank you for getting back, but I’m sorry unfortuantely it is not possible.
The plugin performs a SUM query (https://www.w3schools.com/sql/func_sqlserver_sum.asp ) that already returns the sum of the order totals according to some settings (like dates, product id, categories,...). So once the result is computed, it cannot be eventually filtered by them. They would just get a number.
What they should do, is simply to report to you which is the metadata key name that identifies the order as “duplicate”. In that case, I can use it to exclude those special orders from the computation.
Thank you.
Hi, please take a look, I got a response from the WC Marketplace Plugin Team: ”>> You can identify suborders( i.e duplicate orders ) by ‘post_parent’ because normal orders post_parent usually set as 0 but our suborder’s post_parent set as the original order id. You can exclude the suborders( i.e duplicate orders ) by checking ‘post_parent’.”
Thanks you
Hi,
thank you very much for reporting the response.
I’ve just released the 8.3 version that implements that enhancement. You can manually download the new version via CodeCanyon or receive as an automatic update by installing and configuring the Envato updater plugin: https://goo.gl/pkJS33 (here the guide that explains how to configure: https://envato.com/market-plugin/ ). To manually update just deactivate and delete the old plugin version and then install the new one. Don’t worry you won’t lose any data 
Give a try and let me know!
Was it ok? 
hi. nothing changed same result with double… after reinstalling the new version, plugin is still version 8.2, although inside I see that the files were edited on August 14
maybe I should try later
It is stange, it seems that the CodeCanyon did not published the update.
I’ve just forced the publishing process, you whould now be able to download the 8.3 version! Please give a try and let me know! 
Hooray! All is decided 8.3 version! thank!
Glad to hear that! You’re welcome 
At last but not least, I would ask you to support me: If you enjoyed my efforts to assist you and/or my plugin please consider leaving the 5 stars, I would really appreciate it! 
(to leave a rating: go to your profile page, click on “Downloads” and from there you can rate to your purchases.
You can also leave the rating through the plugin description page: https://www.dropbox.com/s/28dae6pnqvbccmm/rating_area.jpg?dl=0 )
Have a great day! 
Hi, I have already purchased the plugin. However, I have two issues. 1. After a membership has reached the end date, the progress of the other type of membership are still showing the progress bar. How to remove them?
2. How can we start the membership by the user’s first purchase instead of specifying a fixed date range?
Hi,
what do you mean with “membership” ? could you provide more details about your scenario? Thank you.
I am testing the member expiry. For example, a new user purchases the first item today. Then the user will start the first membership. After reaching $1000, the user will promote to next membership. After 365 days, the membership will reset. The role will become customer and all membership progress will be removed.
I’m sorry, but the plugin hasn’t any concept of “membership”. What do you mean when a membership reches the end date?
you can only sent a time renge in which the plugin computes the amout spent and assign a role. After that range, you may eventually enable the option to remove the assigned roles and assign new ones.
If you create multiple “role per amount” roles, they be indipendent.
I’m sorry, but there isn’t any option to use the “user first product purchase date”.
Hi, understand. However, when a user purchase has already reached the time range end date, how can it remove the progress bar at the bottom as shown in my screen capture?
I mean the whole Sliver badge should be removed.
By default, the plugin will always show the progress of the existing amount per role rules.
If you wish however to customize the display of that area, you can edit the next_roles_list.php you find in the templates folder inside the plugin.
Inside the loop defined at line 25, the $end_date the end date of the rule. You can then customize by eventually skip an iteration if the $end_date is greater than “today”.
I can find the line that you mentioned, but I am not sure how to modify the code. Would you please show me what to insert into the code so as to achieve it? I just want when each Tier has reached the end date, the Tier badge will be removed. It does not make sense that the Tier badge will keep there after it is expired.
if(date("Y-m-d H:i") >= $end_date)
continue;
can you can define at line 20. it should look like this:
https://www.dropbox.com/s/63z69vtlytssnqj/wcra_custom_code.jpg?dl=0
I have tested it. It looks like that it only works for Year-Month-Date, can it include Hour and Minutes?
if(date("Y-m-d H:i") >= $end_date_obj->format(Y-m-d H:i))
continue;
Hi,
after the member expired, it will automatically update the role by cron job ?
I’m sorry the plugin hasn’t such a feature.
Hi,thank you for your reply.
What i mean is if a member already expired, how can it return to basic role. By wp_schedule_event ?
Please note that plugin hasn’t any concept of member or membership.
You can eventually create “role per amount spent” or “role per product” rules. For both rule types, you can eventually assign an expiration date. After that period, you can remove the assigned roles and eventually assign new ones.
The expiration is computed every time the user accesses the site or when an order has been placed.
You can eventually configure an automatic recomputation. That process relies on a wp_schedule_event.
When users purchase a specific WC order, role A is assigned for 12 months then it expires and goes back to role B. If I delete all WC orders to keep my database clean, will that interfere with Role-O-Matic assignment of role A?
Example:
User places an order in WooCommerce in June 2020. Role-O-Matic is triggered and applies role A for 12 months, starting June 2020.
In September 2020, admin deletes all WooCommerce orders, including the original order in June 2020.
Does Role-O-Matic keep the 12 month assignement of the role and further expiration? What happens in that scenario?
Thanks.
Hi,
yes it may interfere. In general, if you edit or delete an order, it will trigger the role recomputation for the user associated to that order. So in your case, the amout spent could not match the one set in the “role per amout” rule anymore causing the user to loose the assigned role prematurely.
If you instead delete the order older that the expiration time you set, it won’t affect the role assignement process.
Hi,
The rule is set so that only the purchase of the product (and not the amount) triggers the assignment of the role. Would this still interfere and delete the role assignment?
Also, what do you mean “delete the order older than the expiration time you set”?
Example:
Order is created in August 2020 (it gives role A for 12 months) Order is deleted in September 2021 (user lost role A in August 2021)
In that case, it seems obvious that the assignment would not be affected, and I guess the “after expiration roles” would be kept, correct?
Thanks again.
In case of the “role per product”, deleting the order won’t interfere.
Hi, I have the following questions. 1. Does this plugin support Elementor with Ocean WP Theme?
2. Is it possible to create an icon or image next to the Role name in the My Account page? e.g. Display a “member card” image above the role name in the My Account page
Thank you.
- The plugin hasn’t any particular support for that plugin features
- I’m sorry, the plugin hasn’t such an option
Thank you. If purchase this plugin, is there any money refund guarantee after some days if i find that it is not suitable for my use?
I’m really sorry, but the Envato licese agreement doesn’t include any trial period.
The plugin has a demo site where you can fully test its features before purchasing. Once purcahsed, no refund will be granted for such reasons.
Hi there, the plugin allows you to have an email sent to a user to notify them of a role change however, that email is fired when the role has been changed on purchase and when the time limit is reached and the role is changed again. Can you have the email fire only when the role is reverted back once the expiration for the user role is reached? If not can you make it so that you can send out another email when the role is expired that is different to the email that they get when they are first allocated the role?
Hi,
To request support, you need to renew your support license.
Once renewed, I can suggest which script modify in order to send the email only after the product expiration date and how to avoid to be sent when roles are assigned on purchase.
Hi there, I have renewed my support with you. Can you please assist with my issue?
Hi,
yes. Actually that is not an issue, but a customization. The plugin is not designed to have the feature you are seeking so to achieve that, it has to be customized.
- Edit the WCRA_Customer.php file you find in the classes\com folder and comment line 392 and 293. That will avoid the email send when a role is assigned.
- On line 427, add the following:
$email_texts_per_user_id = array();
It will look like: https://www.dropbox.com/s/qwfv214mo4apr21/wcra_custom_1.jpg?dl=0 - On line 440, add the following:
$email_texts_per_user_id[$user->ID][] = array('subject' => "", 'body' => "");It will look like: https://www.dropbox.com/s/25xwjse089dt5l4/wcra_custom_2.jpg?dl=0 -
on line 488 add the following:
if(!empty($email_texts_per_user_id)) $wcra_email_helper->send_role_change_notification_to_user($email_texts_per_user_id);It will look like: https://www.dropbox.com/s/do2m93rywql6okp/wcra_custom_3.jpg?dl=0
$email_texts_per_user_id[$user->ID][] = array('subject' => "Thi is the subject", 'body' => "This is the email content!");
In this way, the plugin will also send an email every time it will assign a role after the purchased product has expired