Code

Discussion on WooCommerce Role-O-Matic

Discussion on WooCommerce Role-O-Matic

Cart 510 sales

vanquish supports this item

Supported

207 comments found.

Hi there, I am developing a membership based site build on BuddyPress restricting components like private messages. I have another plugin restricting BuddyPress components by using user roles. what I need is a plugin which canchange the role from subscriber (inactive role) to customer, when a (virtual) product is purchased, and role change back to subscriber (inactive) role after the expiration of the period. Is WooCommerce Role-O-Matic what I need?

regards Carsten

Hi Carsten,
yes the plugin allows you to do that. Just configure a “role per product” throught the Products configruator menu in the admin area.

The plugin has a demo site where you can fully test the software in order to be sure it actually works as you need and if it fits your expecations. In case of further info, feel free to ask!

Can I use this along with User Role Editor to then allow my customers to create blog posts? E.g. a customer makes a purchase, Role-O-Matic assigns them to Role “Blogger”, which I’ve defined in User Role Editor as having access to create and edit posts?

Yes, the plugin allows you to assign custom roles created with 3rd party plugins :)

Hola Amigo!

About https://codecanyon.net/comments/19652150

Point 2 : Yes, the item is re-purchased when the subscription is renewed

I wanted to tell you that indeed, your plugin works very well together with subscriptions (tested with Yith Subscriptions).

When the subscription reaches its time limit, to stay active it must be renewed, it is at that moment that it is renewed.

The subscription plugin generates a new order (buy) “of the item for subscriptions”

With a common item for role or matic and for Plugin subscriptions it is achieved that each time a new order is generated, the role change for the user is also renewed.

It is important that the duration for the assigned role and the duration of the subscription have the same duration.

Saludos.

Hi,
thank you very much for letting me know :)

At last but not least…If you enjoyed my support and/or my plugin please consider leaving the 5 stars, it would help me with sales and I would really appreciate! :)
(to leave a rating: go to your profile page, click on “Downloads” and from there you can rate to your purchases)

Have a great weekend! :)

Hello,

There seems to be a bug with latest versions:

Fatal error: Uncaught Error: Call to a member function get_rules() on null in /var/www/html/wp-content/plugins/woocommerce-role-by-amount-spent/classes/com/WCRA_Customer.php:37 Stack trace: #0 /var/www/html/wp-includes/class-wp-hook.php(286): WCRA_Customer->perform_role_recomputation_on_user_site_access(Object(WP_Query)) #1 /var/www/html/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(NULL, Array) #2 /var/www/html/wp-includes/plugin.php(515): WP_Hook->do_action(Array) #3 /var/www/html/wp-includes/class-wp-query.php(1634): do_action_ref_array(‘pre_get_posts’, Array) #4 /var/www/html/wp-includes/class-wp-query.php(3230): WP_Query->get_posts() #5 /var/www/html/wp-includes/post.php(1763): WP_Query->query(Array) #6 /var/www/html/wp-content/plugins/yith-woocommerce-custom-order-status-premium/class.yith-wccos-admin.php(257): get_posts(Array) #7 /var/www/html/wp-includes/class-wp-hook.php(286): YITH_WCCOS_Admin->get_custom_statuses(Array) #8 /var/www/html/wp-includes/plugin.php(203): WP_Hook->apply_filters(Array, Arra in /var/www/html/wp-content/plugins/woocommerce-role-by-amount-spent/classes/com/WCRA_Customer.php on line 37

Regards

Thats the issue, installed it via panel it works.

Could you add WP-CLI compatibility to your roadmap?

Thanks

Also, a sidenote;

WP-CLI is not breaking the plugin, the plugin however conflicts with WP-CLI (maybe the initialization); as if the plugin is enabled, nothing can be installed via WP-CLI.

Have to disable the plugin each time in order to use the WP-CLI.

Regards

Thank you for reporting the result of your investigation. Please try updating the plugin to the latest 5.1 version. I’ve implemented a method that should avoid the plugin to be initialized at all in case of WP-CLI usage (in this way you should no longer have those error messages). Let me know if you still experience the issue.

Hello, I have WordPress and WooCommerce store up and running. I have some customer user accounts on WordPress, they are users that come to my website, login and see the product prices. I would like to enter a % number on a customer account, and this customer should see the % price of all the products. For example, customer A should see the 95% of all the prices on all products, customer B should see 90% of all the prices on all products, etc. I would just enter the number % on the customer account. So,I basically need a plugin to show product prices according to a customer account % number, and this number should be unique to each account. Can this plugin do this? Thank you.

Hi,

I just added this plugin to a very complex wordpress woo commerce site.

I achieved everything I wanted but one thing is problematic.

Im using another user role management plugin for the creation of users and several other features.

With Role-O-Matic I am covering 2 shortcomings of the first plugin:

1- Assigning roles to specific purchases with more options 2- Forbid a user to buy a product if a specific role is assigned to them

But at the moment Im having an issue with the second one. For logged in users the rules are working I believe. But for guest users cant add the products either. CDo you have any idea why this might be happening?

Thanks

Hi,
thank you for reporting the issue. I think I know why, please update to the latest 4.8 version that I’ve just released!

You can manually download the new version via codecanyon or receive as 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/).

Let me know if you still experience the issue! :)

Works like a charm. Thank you. Fastest official update release I ever got :)

Yeah, very glad to hear that! Thank you for the rating, I reeeeeally appreciate! :)

Have a great day!!! :)

Hi, We have this message when we click on “Role-o-matic” menu: “Cannot load woocommerce-role-by-amount-spent.” The other options in the role-o-matic menu work.

Regards, Richard.

Hi Richard, whithout any further clue it is quite hard to determine the cause. Try logging with a full admin account and eventually to disable all your 3rd party plugin to see if any is interfering.

Hi Vanquish and thank you for your reply. After logging in with the full administrator account and having disabled all third party plugins except woocommerce, the first time it worked for the woocommerce-role-by-amount-spent page, but after activating all the other plugins it did not work. I restarted a second time by activating woocommerce and your plugin only and there the woocommerce-role-by-amount-spent page still displayed the same error message. it seems unstable…

As you can see from the demo site the plugin properly works and activates withotu any problem.
furthermore no other user reported such an issue, so it depends to an issue specific of your wordpress installation.

It seems that a 3rd party plugin is preventing it to properly initiate its menu or that your wordpress installation is not properly managin user account capabilities allowing to properly access to plugin pages.

Without any further clues however for me it is quite impossible why your wordpress is misbehaving this way. Have you installed any plugin that alters user role capabilities? If you send me via private message (click on my name and then use the low-right box) the following data:
  1. you email address
  2. Full admin access to the wp-admin area
  3. a FTP access
  4. a detailed step by step guide on how to experience the issue

I can try performing some tests to see if is possible to have more clues about the issue.

Hi,

I have this problem when trying to use WP-CLI on the website where the plugin is installed:

Fatal error: Call to a member function get_rules() on null in /wp-content/plugins/woocommerce-role-by-amount-spent/classes/com/WCRA_Customer.php on line 37

I’m on 4.6 plugin version, WP 4.9.6, Woocommerce 3.2.6

Thanks a lot in advance

Hi,
it is because it seems that you are not properly initializing the plugin, this causes its global variables to be not initialized and then that error is raised.

Make sure that plugins are properly initiated and the issue will be gone.

Hi again,

sorry in advance for my stupid question, but what do you mean by “initializing” the plugin? The plugin is installed and works flawlessly, it’s only when I try to do anything by WP-CLI that I see this error in terminal and the command fails.

Could you please describe which steps I have to do to properly initialize it?

Thanks

No problem. As you can see in the main plugin file woocommerce-role-by-amount-spent.php (you find it in the root of the plugin folder), there are several variables defined and initialized. For example you find on line 62:
$wcra_role_per_product_model = new WCRA_RolePerProductRule();

that line initializes the $wcra_role_per_product_model object that lately is used in the spent/classes/com/WCRA_Customer.php on line 37 (the error that you reported).

It seems that when you are using the WP-CLI, it is not properly executing the main plugin file (so initializing the plugin).

Try then investigate why it is not and eventually fix it.

hey, i cant use your plugin anyhow. I installed it on a test-domain aswell. On first site it worked very well, on other site, it’s not working. After i deactivate and active on old site, plugin deactives here aswell.

brillant ! it worked =)

Yeah, glad to hear that :)

If you enjoyed my support and/or my plugin please consider leaving the 5 stars, I would really appreciate! :)
(to leave a rating: go to your profile page, click on “Downloads” and from there you can rate to your purchases)

You Welcome :)

Hi there,

My support has ended long ago..

This plugin has been superb and serving me well. However, just noticed one small issue that I would appreciate if you could assist..

For instance, I assigned Role from “Customer” to “member” automatically if they spent $120. I also have this rule (from other plugin) that upon spending $120, they will get a 5% discount.

As 5% off $120 is below $120, they will not be automatically assigned “Member”. Is there a settings that states $120 minimum spend (before discounts, coupons, etc.)?

Hi,
thank you for your appreciation :)

Unfortunately there isn’t any feature to grant support to any 3rd party plugins that manipulate the order total with custom discount.s If you however know that every time an users spends $120 dollars a discount is applied, try then modifing the rule assigning as minimum spent as 126$.

Hi

Thanks for the prompt response.

Actually I’m not asking to grant support to 3rd party plugins. But rather if there is any guidance on how I could change the plugin’s file (file location etc.) in order to pull the Cart Value (before WooCommerce default coupons are applied) for minimum amount .

$126 can’t work because there is a promise to the customers that $120 will get them the 5% and automatic membership.. :(

You could have a look to the get_orders_by_date_and_user_id function defined in the WCRA_Order.php file located in the classes\com folder.

That function performs a custom query (in order to have better performance) retrieving the sum of the order_total metadata of the orders according the curent user and the data range.
If you know how and where the discounted amount is stored, you can modify that query subtractling the discount.
In alternative you can leave the query unaltered but for each order, retrieve the eventual discount and then subtract it from the $result->order_total element.

I hope this helps! :)

Hi !

please, send me the link.

Saludos

You have knowledge of whether it is compatible with “https://es.wordpress.org/plugins/s2member/”

Also, your recommendation …

What subscription plugin is recommended for use with Role O Matic?

I ask you why.

I need a buyer to pay for the order and that order assign a ROLE.

S2 Member provides 4 levels

s2member_level1

s2member_level2

s2member_level3

s2member_level4

S2 Member allows you to control downloads per day and per month.

Possible scenarios.

1. The buyer buys #oredert $ 100 for a soft, that assigns him a role s2member_level2 for 30 days.

This allows S2 Member to quote user downloads for 30 days.

2. Subscription with recurrent payment #order per annual subscription, this assigns a role s2member_level4

This allows S2 Member to quote user downloads for 30 days.

Saludos

No for now it is not possible. That feature is not planned to be implemented however I’ll see if something will be possible in a future release, but I cannot give you any eta.

Thank you very much for your answer.

The plugin is awesome, very useful, I like it a lot.

Even without this option that I need, it is indispensable to me!

I ask you one more question ….

Is it possible to associate a role based on “Role per amount” on a certain product or category?

For example $ 100 every 30 days Role of user “MONTHLY ROLE” if you buy the product “Monthly Product” or buy a product of the “category thirty”

If you do not find a payment for that product for the 30-day period, then when you recalculate the plugin, delete the “Role per amount”

For that, you can use the “Product(s) restriction” and “Category(ies) restriction” options: https://www.dropbox.com/s/sfkxfy63zxvx984/wcra_product_restriction.png?dl=0 while configuring the rule.

In addition select as order status used to compute roles (General options menu) only the ones assigned when the order has been payed.

At last but not least…If you enjoyed my support and/or my plugin please consider leaving the 5 stars, I would really appreciate! :)
(to leave a rating: go to your profile page, click on “Downloads” and from there you can rate to your purchases)

Hello, Just spent the last few weeks troubleshooting my woocommerce store with subscriptions because automatic renewals were not working and we lost a lot of clients because of it Love the plugin but it has a huge bug in it, that causes woocommerce subscription renewals to fail. (with no error point back to role-o-matic btw) We finally narrowed it down to role-o-matic by disabling all plugins except woo commerce and woo subscriptions, then the minute role-o-matic is activated the renewals fail again. When deactivated it works… I really need the role assignment so want to know if this is something that is going to be fixed. thanks – Dave

Unfortunately wordpress doesn’t allow to disable plugin during certain process :(

However, as you can see from the error you reported, actually the script that make the site crash is part of the “WooCommerce stripe gateway”: /nas/content/live/davemfrank/wp-content/plugins/woocommerce-gateway-stripe/includes/class-wc-stripe-helper.php , so unfortunately there isn’t much I can do. You should then report this issue to its developer or eventually try disabling it to see if you stil get the issue.

Ok thanks for taking a look, the woocommerce stripe script is what runs from the scheduler to renew the subscriptions. I’m pretty sure if I reach out too woocommerce and say the script fails when I have a certain plugin enabled they’ll tell me to disable that plugin. They already told me before the renewal issue was caused by a plugin and to find out which one then disable it.

Unfortuantely I cannot do much more. Eventually I can suggest to custom modify that plugin script. That line should look like ( I found hte script here: https://github.com/woocommerce/woocommerce-gateway-stripe/blob/master/includes/class-wc-stripe-helper.php ) :
public static function delete_stripe_fee( $order = null ) {
        if ( is_null( $order ) ) {
            return false;
        }
        $order_id = WC_Stripe_Helper::is_pre_30() ? $order->id : $order->get_id();
        delete_post_meta( $order_id, self::META_NAME_FEE );
        delete_post_meta( $order_id, self::LEGACY_META_NAME_FEE );
    }
Add at 108 (before the $order_id = [...]) something like:
if(is_bool($order))
return false;

It should prevent that fix. However in case of update remember to restore that customization and try at your own risk.

At last…If you enjoyed my efforts to support and/or my plugin please consider leaving the 5 stars, I would really appreciate! :)
(to leave a rating: go to your profile page, click on “Downloads” and from there you can rate to your purchases)

Is there a way, to sync all CUSTOM roles set by roleomatic to all sites in multisite-network?

I know. But as i see at your plugin, you are ingenious programmers. So i wonder, if you know some helpful filters :)

I’m sorry, but unfortunately I do not know how this can be achieved :(

Okay, thank you anyway :))

Hi, I have a question regarding for Time Period Type. I understand that there is an option for Dynamic period and Time range span, but I realized the dynamic type defined a time range goes from “now” to the “last”.

However, my rule is the user currently has a basic role, and when the user spends $xxx in the next 180 days, the user will gain a higher level role. Based on this plugin, I wont be able to know when the user will become a certain role, so I think it s unable to count the time range back?

My rule example: Andy has a ‘Customer role’ on 2018/5/1, and when he spends $12960 within the next 180days, he will promote to ‘Regular Customer role’

How can I set this rule based on the functions available in this plugin?

Thanks for your help!

Hi, the plugin as you said allows to assign a role accoring the amount a customer spent is $xxx in:
  1. define time range
  2. a time span that goes from to day to the last YYY days (like the last 180 days)

So there isn’t any option to set a specific time range which the start date is “now” and as end date “now” + YYY days.

If for your purpose you do not want to consider the last 180 days for your rule, you should then for now create a fixed time range (that goes from now to the future 6 months) and in 6 month change its time strategy making it consider a dynamic perido that goes from “now” to the latest 180 days.

On every setting page for this plugin, it gets stuck on the spinning circle when I click the “Update” button. I cannot save any settings. When I add a new rule, I cannot save it because it gets stuck on the spinning circle when I try to update.

Hi,
without any other clue it is quite hard to determine the cause. Try enabling the wordpress log debug mode ( https://codex.wordpress.org/Debugging_in_WordPress ) and see if any error is printed in the debug log. Check also your server log to see if any error is reported.

It could also depend on a too low value of the PHP php max input vars var. Check the WooCommerce -> Status -> PHP Max Input Vars. It should be above 6000, if not please your PHP.ini file and se the max_input_vars variable to a value greater than 6000. Once done, restart your server and go in the Status menu and make sure that the change took effect

Hi,

PreSale Question?

Is this compatible to WooCommerce Deposits Plugin and their Partially Paid Status. For example if the required amount is 50$ to become VIP then the customer order 100% but they paid only half which is 50$ if we change the status to Partially Paid, can they become VIP or not.

Also for the WooCommerce Order Status & Actions Manager because we are using may custom order status.

Thanks

Hi,
no the plugin hasn’t any particular support for the WooCommerce Deposits plugin.

For what concerns the custom statuses, if they are properly implemented and they are fully WooCommerce compliant, there should be no problems.

Hi, I have the following error on my dashboard page when selecting 1(My account page – Display current assigned role list) and 2 (My account page – Display next role list) options:

Warning: date_add() expects parameter 1 to be DateTime, boolean given in /home/bhwoo731/public_html/wp-content/plugins/woocommerce-role-by-amount-spent/classes/com/WCRA_Order.php on line 123

Warning: date_format() expects parameter 1 to be DateTimeInterface, boolean given in /home/bhwoo731/public_html/wp-content/plugins/woocommerce-role-by-amount-spent/classes/com/WCRA_Order.php on line 124

Warning: date_add() expects parameter 1 to be DateTime, boolean given in /home/bhwoo731/public_html/wp-content/plugins/woocommerce-role-by-amount-spent/classes/com/WCRA_Order.php on line 123

Warning: date_format() expects parameter 1 to be DateTimeInterface, boolean given in /home/bhwoo731/public_html/wp-content/plugins/woocommerce-role-by-amount-spent/classes/com/WCRA_Order.php on line 124

Warning: date_add() expects parameter 1 to be DateTime, boolean given in /home/bhwoo731/public_html/wp-content/plugins/woocommerce-role-by-amount-spent/classes/com/WCRA_Order.php on line 123

Warning: date_format() expects parameter 1 to be DateTimeInterface, boolean given in /home/bhwoo731/public_html/wp-content/plugins/woocommerce-role-by-amount-spent/classes/com/WCRA_Order.php on line 124

Hi,
it seems that the $start_date variable is not containin a proper date string. It sonds strange because it should be computed by the statement defined in line 91 in which it is computed using the native php date() function.

It could rely on a server issue, however without any further clue it is quite hard to determine the cause. Which version are you using? is the latest 4.5 version? If not, could you try updating and report me if you still get the issue?

If so, if you send me via private message (click on my name and then use the low-right box) the following data:
  1. you email address
  2. Full admin access to the wp-admin area
  3. a FTP access
  4. a detailed step by step guide on how to experience the issue

I can try to debug that script in your server to have more clue about the cause and eventually implement a fix. Thank you.

I have a problem with the Woocommerce-Role-O-Matic plugin. The last function in the woocommerce-role-by-amount-spent/classes/com/WCRA_Cron.php file breaks front-end user registration. I have custom fields in registration through Advanced Custom Fields, however, upon registering, I get the get_current_screen is an undefined function error which can be referenced from here: https://codex.wordpress.org/Function_Reference/get_current_screen I have commented out this function and it works as expected, however, I would like this to be looked into. Thank you.

Hi,
thank you very much for reporting the issue. I’ve just released the new 4.5 version that should fix it. Give a try and let me know!

You can manually download the new version via codecanyon or receive as automatic update by installing and configuring the Envato updater plugin: https://goo.gl/pkJS33

At last…If you enjoyed my support and/or my plugin please consider leaving the 5 stars, I would really reeeeeally appreciate! :)
(to leave a rating: go to your profile page, click on “Downloads” and from there you can rate to your purchases)

Hi, can you please tell me does this plugin assign new role based on one time purchase amount or total amount through some time period. And does it work good with Woocommerce dynamic pricing & discounts from Rightpress? Thanks

Hi,
the plugin hasn’t any particular support for the Woocommerce dynamic pricing & discounts plugin from Rightpress.

For more info about the plugin, please go to the description page. The plugin has also a demo site where you can fully test it before purchasing in order to be sure it actually fits your needs and expectations.

by
by
by
by
by
by

Tell us what you think!

We'd like to ask you a few questions to help improve CodeCanyon.

Sure, take me to the survey