Jump to content
Kian

Conditional Support Departments

Recommended Posts

Restrict the access to support departments based on the products purchased by users. Define rules as follows.

$department['1'] = array('45', '46', '10');
$department['2'] = array('85', '86', '10');
// Keep adding rules one per line

The key of $department array (the [1] and [2] between square brackets) corresponds to the ID of the support department for which we are creating a rule. The value is an array() of product IDs required for access. In a in nutshell, the above configuration unlocks department #1 to users with product IDs 45, 46 and 10. Department #2 requires 85, 86 and 10.

Here are few more things to consider:

  • submitticket.php doesn't show restricted departments
  • Access via direct link submitticket.php?step=2&deptid=2 triggers a redirect to submitticket.php
  • Department dropdown lists only allowed department
  • The same product can be used for multiple rules
  • Pending, Suspended, Terminated, Cancelled and Fraud products are ignored

Get the Code »

Share this post


Link to post
Share on other sites

  • Similar Content

    • By Kian
      Client group background colors no longer display on ticket view page. Go figure out why WHMCS decided to remove it from v8. This action hook puts the styling back.

      Get the Code »
    • By Kian
      As you probably know WHMCS v8 no longer provides statistics on top of the page about pending orders, overdue invoices and tickets awaiting reply. This action hook adds them back to interface as you can see from the following screenshot.


      This badge is fully responsive and appears if there's at least one pending order, overdue invoice or ticket awaiting reply. If there's nothing to show it disappears. To avoid any possibility of confusion, the hook automatically detects if you're running v8.
      Get the Code »
    • By AhmedmZaki
      i'm try to add new payment method "third party " it's ok i added to thw whmcs also the payment is redirected to the payment portal but when it's come back i get error

      knet.php
    • By Kian
      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 »
    • By Kian
      This hook is similar to the one that assigns clients to groups based on purchases. This time we're assigning clients to groups based on registration date or more precisely on user seniority. Let's take this code as example.
      $groups['1'] = '90'; $groups['2'] = '180'; $groups['3'] = '365'; They key of $groups array (eg. ['1']) represents the ID of the group while the value user seniority (days between registration date and current date). According to the above configuration, here is what happens:
      Customer A registered 34 days ago. No change Customer B registered 90 days ago. He goes to client group ID 2 Customer C registered 364 days ago. Still group ID 2 Customer D registered 500 days ago. He goes to client group ID 3 Optionally, you can turn on any of the following features to add some restrictions:
      $activeCustomers rules apply only on Active customers (boolean true or false) $oldestPurchase rules apply only on if customer has a product/service or domain older than the given number of days (integear) The hook runs with WHMCS daily cron job meaning that tomorrow the customer C of the above example will move from group 2 to 3.
      Get the Code »
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • 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