Thanks for purchasing our plugin! I understand you'd like to have the group rules trigger only when orders are completed rather than just placed.
Could you please share a screenshot of your current group rule(s) setup? This would help me better understand your configuration.
I believe there might be a specific setting we need to look at - it seems you may be using "Total Spent (Total Order Value)" rather than "Monthly Spend" for your rules. These two types of rules use different calculation algorithms, and the Monthly Spend rules typically only update at the start of each new month rather than with each individual order.
Once I can see your current rules setup, I'll be able to provide more specific guidance on how to achieve what you're looking for.
I have one Total Spent rule and all other rules are Monthly Spend.
The problem is the same for Total Spent and Monthly Spend rules.
For example, when the customer with a group role Standard makes order for 1000€ at the end of the month he will automatically move to the Plus group even if the order is not completed. And if the order is canceled for some reason, the customer will still remain in the Plus group and will have a discount, which is not quite correct.
Here is text description for my group rules.
Basis - starting group for all customers after registration.
Standard - for all customers who have made at least 1 order of at least 200€
Purchase volume per month: from 200€ to 999.99€
Discount on the shopping cart: 0%
Plus
Purchase volume per month: from 1,000€ to 2,999.99€
Discount on the shopping cart: 2%
Reach this level by spending at least 1,000 per month.
Premium
Purchase volume per month: from 3,000€
Discount on the shopping cart: 4%
To achieve this status, you must spend at least 3,000€ per month.
In addition, if the client has spent less than the amount specified in each of the groups for the month, then his group is downgraded to a lower level (minimum level is Standard).
I went over your desired configuration and existing rules setup.
I feel like the best option based on your requirements is to use a custom algorithm rather than existing rules. This would give more flexibility and allow you to set thi sup.
We can help implement that. I wrote a code snippet here that I believe should be able to achieve that.
Steps to take:
(1) Delete all B2BKing group rules under B2BKing -> Group Rules in the backend
(3) Edit the beginning of the code to set up your own group IDs (these are unique on each site):
Replace 1, 2, 3, 4 in this function with your group IDs.
To get the ID of each group, go to B2BKing -> Groups and edit each group, and check the number in the URL (e.g. if you see ?post=123 when editing the group, the group's ID is 123).
This code should:
Only work with completed orders
Run on the 1st of each month, checking the completed orders total of the previous month
It should never downgrade users below standard
As an exception, basic users are immediately moved to Standard on their 1st order of min 200, without having to wait for the 1st of the next month.
This code does not do anything if a previously completed order changed from Completed status to a different status like Refunded / Cancelled. I'm not sure if you need that as well. If so, would that apply only for orders in the previous month? (what about an order from 3 months ago)? would that recalculate the current month's group based on the newly recalculated order total of the previous month?
Hello,
I'm using Group Rules to change Group Roles accordingly to monthly order value.
The group role changes when a customer has placed an order, and I need it to change only when the order is completed.
Is there any ability in your plugin to do this?
Hi Ekaterina,
Thanks for purchasing our plugin! I understand you'd like to have the group rules trigger only when orders are completed rather than just placed.
Could you please share a screenshot of your current group rule(s) setup? This would help me better understand your configuration.
I believe there might be a specific setting we need to look at - it seems you may be using "Total Spent (Total Order Value)" rather than "Monthly Spend" for your rules. These two types of rules use different calculation algorithms, and the Monthly Spend rules typically only update at the start of each new month rather than with each individual order.
Once I can see your current rules setup, I'll be able to provide more specific guidance on how to achieve what you're looking for.
Kind regards,
Stefan
Hi Stefan,
I have one Total Spent rule and all other rules are Monthly Spend.
The problem is the same for Total Spent and Monthly Spend rules.
For example, when the customer with a group role Standard makes order for 1000€ at the end of the month he will automatically move to the Plus group even if the order is not completed. And if the order is canceled for some reason, the customer will still remain in the Plus group and will have a discount, which is not quite correct.
Here is text description for my group rules.
Basis - starting group for all customers after registration.
Standard - for all customers who have made at least 1 order of at least 200€
Plus
Premium
In addition, if the client has spent less than the amount specified in each of the groups for the month, then his group is downgraded to a lower level (minimum level is Standard).
Attached files: e4e8e5fe-647e-4df9-9fa2-eb0583560431.png
Hi Ekaterina,
Thank you for those details,
I went over your desired configuration and existing rules setup.
I feel like the best option based on your requirements is to use a custom algorithm rather than existing rules. This would give more flexibility and allow you to set thi sup.
We can help implement that. I wrote a code snippet here that I believe should be able to achieve that.
Steps to take:
(1) Delete all B2BKing group rules under B2BKing -> Group Rules in the backend
(2) Copy the code snippet from https://pastecode.io/s/8r3re1jm and add it to functions.php or a snippets plugin
(3) Edit the beginning of the code to set up your own group IDs (these are unique on each site):
Replace 1, 2, 3, 4 in this function with your group IDs.
To get the ID of each group, go to B2BKing -> Groups and edit each group, and check the number in the URL (e.g. if you see ?post=123 when editing the group, the group's ID is 123).
This code should:
This code does not do anything if a previously completed order changed from Completed status to a different status like Refunded / Cancelled. I'm not sure if you need that as well. If so, would that apply only for orders in the previous month? (what about an order from 3 months ago)? would that recalculate the current month's group based on the newly recalculated order total of the previous month?
Let me know if you need any adjustments,
Kind regards,
Stefan