Jump to content

Client to Group based on Registered Domains


Kian

Recommended Posts

The hook assigns clients to groups based on the number of active domains in their accounts (Active, Grace and Redemption). This is particularly useful for Domain Pricing slabs. Let's take this code as example.

$groups['1'] = '10';
$groups['2'] = '25';
$groups['3'] = '100';

The key of $groups array (eg. ['1']) represents the ID of the group while the value the number of active domains. According to the above configuration, here is what happens:

  • Customer A has 10 domains. He goes to client group ID 2. Next day domains become 9. The the customer is removed from the group
  • Customer B has 99 domains. He still goes to client group ID 2 but will be moved to 3 in case he manages to reach 100 domains
  • Customer C has 250 domains. Group ID 3

The hook runs with WHMCS daily cron job meaning that customers are moved (or removed) from groups on a daily basis. Optionally, you can use the following feature to add some restrictions:

  • $activeCustomers rules apply only on Active customers (boolean true or false)

Get the Code »

Link to comment
Share on other sites

  • 1 year later...
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated