Jump to content

WHMCS Chance

WHMCS Jr. QA Developer
  • Content Count

  • Joined

  • Last visited

  • Days Won


WHMCS Chance last won the day on July 13 2015

WHMCS Chance had the most liked content!

Community Reputation

4 Neutral

1 Follower

About WHMCS Chance

  • Rank
    Jr. QA Developer

Recent Profile Visitors

1739 profile views
  1. Feeling Dev-y today.  Let's make WHMCS EVEN BETTER!

  2. Assumption correct 🙂 And no worries at all, keeping it old skewl has its advantages as well!
  3. Hey @brian!, Might I suggest instead of using the global $CONFIG You use the WHMCS class to pull the settings as documented here: https://docs.whmcs.com/classes/7.6/WHMCS/Config/Setting.html So something like; <?php if (!defined('WHMCS')) { die('This Hook should not be run directly...'); } use WHMCS\Config\Setting; # Hide VAT ID Fields For Contacts Hook # Written by brian! add_hook('ClientAreaFooterOutput', 1, function ($vars) { $templateFile = $vars['templatefile']; $contactPages = ['clientareacontacts', 'clientareaaddcontact']; if (in_array($templateFile, $contactPages) && Setting::getValue('TaxIDDisabled') == '1') { $removeTaxIdField = "<script> $(function() { $('label[for=inputTaxId]').remove(); $('#inputTaxId').remove(); }); </script>"; return $removeTaxIdField; } }); Also, I would add that using the ClientAreaFooterOutput hook point over the ClientAreaHeadOutput would be more beneficial as if there were an error it wouldnt stop the rest of the page from loading where as if you add custom jQuery/HTML in the footer, it wont break the entire page from loading...Just kinda a safe guard that I moved over too awhile back when coming up with hooks for clients while in Support. 🙂 Otherwise it looks good, btw I did make a few small formatting changes to your original implementation from a syntax point of view 😛 I did test this on 7.7.1 and works as intended so there is that! Thanks!
  4. Hey @battles, Perfect, sounds good. Support is standing by waiting to assist!
  5. Hey @WH user, I can confirm that we are looking into adjusting the behavior to be persistent across logins however were still reviewing the best path forward on this. Thanks!
  6. Hey @battles, This is correct, it simply needs to point to your WHMCS systemURL you have defined in Setup >> General Settings >> General Tab :: SystemURL. We format the callback URL in the _POST that we make to Paypal so it knows the correct callback file to use. You can check for any errors with callback processing under Billing >> Gateway Log and check the Paypal documentation page I previously provided in my last reply down towards the bottom of the page for common errors that you may see there. If you have further issues with this, you can always open a ticket with Support for further assistance in investigating this further 🙂 Thanks!
  7. Hi all, We have an internal case to visit this issue where the toggle switch for `Hide Inactive Clients` is not being honored: `CORE-13099` I do not have an ETA on when this will be resolved but you can check the changelog when we release new updates and search for the case provided above to see if this was included @ http://changelog.whmcs.com/ Thanks!
  8. This is returned in the Paypal callback once the client has successfully setup a PP Subscription. This should be instant and is dependent on having the appropriate IPN notification URL setup in your PP account as we note on the PP gateway config page in the admin area under Setup >> Payments >> Payment Gateways :: Manage Existing Gateways. You can read more about setting up IPN settings for PP here: https://docs.whmcs.com/PayPal#Instant_Payment_Notification_.28IPN.29 Thanks!
  9. Hey there, Have you checked over our docs pages for Common Promotions: https://docs.whmcs.com/Common_Promotions#Free_Trial https://docs.whmcs.com/Products_and_Services#Pricing_Tab As Bear mentioned, its rather difficult to provide a 60day promo to anything outside a monthly cycle. The best way to do this is how we have listed in the Free Trial promo docs page, where you have 2 products, one is what you will use the free trial promo code on and then once they term out it will upgrade them to the actual product set on the proper term you want them to use. Hope that helps.
  10. Hey everyone and welcome to the SkunkWorx forum! Today we are going to be looking at a hook that will create an output for your Admin Area in WHMCS for support tickets. This output will provide a banner with the number of Staff Online and the number of tickets in the Awaiting Reply status which by default is how tickets requiring a response will be shown when you pull up supporttickets.php or clicking on the Awaiting Reply link from the top of the homepage. This is a combination of jQuery and localAPI calls placed inside functions and their results then processed via the AdminAreaFooterOutput hook point. Simply create a new file in your [highlight]includes/hooks/[/highlight] directory and name it something that will easily make it known as to what it does, in this case lets call it Overload.php. Here is the code in which is copy/paste ready and you can download it following this link Overload.txt (simply rename the extension to .php): <?php /** * This hook will check the count of tickets * in Active Status and then using jQuery add * a banner informing of any overload based on * logged in admins. * * @package WHMCS * @author WHMCS Chance * @copyright Copyright (c) WHMCS Limited 2005-2016 * @license https://www.whmcs.com/license WHMCS Eula * @link https://www.whmcs.com/ */ if (!defined('WHMCS')) { die('This hook should not be run directly'); } function checkTicketCount() { $count = localAPI('gettickets', array( 'limitnum' => '1000', 'status' => 'Awaiting Reply' )); return $count['totalresults']; } function checkAdmins() { $getStaff = localAPI('getstaffonline'); return $getStaff['totalresults']; } function showOverload() { $overLoad = checkTicketCount(); $staff = checkAdmins(); $page = $_SERVER['PHP_SELF']; $pos = strrpos($page, 'supporttickets.php'); if ($pos != false) { if ($overLoad <= 9 && $staff <= 1) { $show = '<script> $(function() { $(\'<div class="alert alert-success text-center">Tickets are looking good!!!! <div style="font-size: 14px;">Staff Online: <b>'.$staff.'</b></div><div style="font-size: 14px;">Tickets: <b>'.$overLoad.'</b></div></div>\').prependTo("#contentarea"); }); </script>'; } elseif ($overLoad >= 10 && $staff >= 1) { $show = '<script> $(function() { $(\'<div class="alert alert-danger text-center">We are in <b>OVERLOAD</b>!!!! <div style="font-size: 14px;">Staff Online: <b>'.$staff.'</b></div><div style="font-size: 14px;">Tickets: <b>'.$overLoad.'</b></div></div>\').prependTo("#contentarea"); }); </script>'; } return $show; } } add_hook('AdminAreaFooterOutput', 1, 'showOverload'); Let's break this code down a little bit and I will give you some points on where to adjust the sensitivity of the hook so you can set it based on your workflow and such. ($overLoad <= 9 && $staff <= 1) This above is what sets the limitations for the hook to show either the All Good or the Overload message which you can see in the screenshots. In the first if statement this is your All Good message so here is where you would set the number of tickets to be lower as this would mean you've got things under control so to speak. In the following elseif statement is the Overload message. Here you would want to put a number 1 higher whatever you have set for your previous check as mentioned above. The same goes for the $staff variable in the if statements as well, you would bump this up or down depending on the number of staff you have and your workflow. function checkTicketCount() { $count = localAPI('gettickets', array( 'limitnum' => '1000', 'status' => 'Awaiting Reply' )); return $count['totalresults']; } In the above function, the localAPI call that is made, you can also pass in deptid as an array item and specify which departments you would like to get the tickets from as well in case you would like to only pull for the Support Department or Sales Deptarment, etc. You can read more about the other variables for this API call here: GetTickets API call I hope that this customization will come in handy for some of you out there looking to add a little flair to your WHMCS installation and in the process, make it more your own. At the time of writing, this hook is tested with the current versions of WHMCS that fall under Active Support as listed here http://docs.whmcs.com/Long_Term_Support#WHMCS_Version_.26_LTS_Schedule]Active Support and are not guaranteed to work with prior versions of WHMCS. I look for any feedback, comments and questions that you may have for me that were not answered already. Thanks!
  11. Hello @harvard, Please ensure that your reseller account has access to the packages in WHM. If you are still having issues, please open a ticket to support and provide logins so we can further investigate. Thanks!
  12. @twhiting9275 The new developer docs pages are in their infancy as we have just rolled out the new changes for this. If you see there is something that is missing, or could use better documentation, please feel free to fork the repo from here: https://github.com/WHMCS/developer-docs Then you will have a version in which you can make modification to and submit a Pull Request for review and if accepted will be merged into the upstream. This will work for everything in the developer docs pages except for the hooks and api lists as these are pulled directly from the doc blocks in the source code itself. You are more than welcome to submit an issue for one of these via GITHUB or open a bug case to have this investigated so we can input the proper case type and have it added. Thanks!
  13. Hey rollerD, This could be due to custom registrar modules that you have added. I would try removing any customizations present on your installation including hooks/addons/modules/etc and see if you are still experiencing this issue. If you are still having issues, please submit a ticket to Support so we can further assist. Thanks!
  14. Hey forum-goers! So with the new feature added of Email Verification, I would like to say that this is in it's infancy. The ground work has been laid in order to build a more feature rich and robust addition to client accounts. However, with a little bit of hook work, you can use this new feature to your benefit. Using the ClientAreaPage hook point, http://docs.whmcs.com/Hooks:ClientAreaPage , you could check in the DB to see if the verification has been completed and allow the client to pass through unaffected. However, if the validation has not occurred you can have it block access to any client area page until they verify. We appreciate all feedback on the new feature added to WHMCS and look forward to the future of our new additions to the core of the product. Thanks!
  15. Hey behnam, Give this code a try as I know this is working: <?php /** * This API call is for OpenTicket which * will open a new support ticket as a client * * @package WHMCS * @link https://www.whmcs.com/ * @author WHMCS Chance * @see http://docs.whmcs.com/API:Open_Ticket */ $url = 'http://yourdomain.tld/includes/api.php'; $user = 'adminuser'; $pass = md5('adminpass'); # Build your request params $request = array( 'username' => $user, 'password' => $pass, 'action' => 'openticket', 'clientid' => '1', 'deptid' => '4', 'subject' => 'API TEST TICKET', 'message' => 'Testing API OpenTicket call to see how this works!', 'priority' => 'high', 'customfields' => base64_encode(serialize(array('8' => 'Custom Support Field Value'))), 'responsetype' = 'json', ); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_TIMEOUT, 60); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($request)); $response = curl_exec($ch); if (curl_error($ch)) { die('Conn Error: ' . curl_errno($ch) . ' - ' .curl_error($ch)); } curl_close($ch); $decode = json_decode($response); # Show it on screen echo '<textarea rows="50" cols="100">' . 'Request: ' . print_r($request, true) . "\n" . 'Response: ' . htmlentities($response) . "\n" . 'Array: ' . print_r($decode, true) . '</textarea>'; That should get you going.
  • 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