Jump to content

Search the Community

Showing results for tags 'hook'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • The latest WHMCS Release
  • The Latest from the WHMCS Team
    • News & Announcements
  • WHMCS.Community
    • Community Announcements
    • Introduce Yourself
  • Using WHMCS
    • Pre-Sales Questions
    • Admin & Configuration Questions
    • Installation, Upgrade, and Import Support
    • Using WHMCS
    • Troubleshooting Issues
    • Vendor Discussions
  • WHMCS Beta Program
  • WHMCS Showcase
    • Showcase Your Site
    • Share Your Best Practices & Tips
  • Developing & Extending WHMCS
    • Third Party Add-ons
    • Service Offers & Requests
    • Developer Corner
    • Building Modules
    • Share Ideas for WHMCS Modules
  • Community Competitions
    • Competitions
  • General Discussions
    • General Discussion
  • General Feedback & Assistance
    • WHMCS.Community Tips & Tricks
  • Third Party Developers's Topics
  • Turkish International Discussions's Topics
  • Russian International Discussions's Topics
  • Spanish International Discussions's Topics
  • Portuguese International Discussions's Topics
  • French International Discussions's Topics
  • Italian International Discussions's Topics
  • German International Discussions's Topics
  • WHMCS Brasil's Topics
  • WHMCS Brasil's Tópicos
  • ModulesGarden Club's Topics
  • Hungarian International Discussions's Segítség
  • ThemeMetro Club's Topics
  • WHMCS Services Club's Topics
  • SwiftModders Club's Topics
  • WHMCS Global Services Club's Topics

WHMCS Version

  • V7 Hotfixes
  • V7.1.x Hotfixes
  • V7.2.x Hotfixes
  • V7.3.x Hotfixes
  • V7.4.x Hotfixes
  • V7.5.x Hotfixes
  • V7.6.x Hotfixes
  • V7.7.x Hotfixes

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start



Found 25 results

  1. Any idea what hook I can add to remove these side bar ads? I'm still selling these products? I just don't want them on the side bar right now. I might add them back later. I checked my current hooks and non seem to line up with these sidebar ads. I assume I need to add a new hook to remove these. Thanks for any help.
  2. hello community hope we all doing well. i just need bit help if you can help me with that. i think i need a hock to remove some menu item from the homepage i need to remove the Store Menu item and the Announcement. can someone guide me with the hook so i can remove them 🙂 thanks in advance everyone 🙂
  3. sokalsondha

    Set next invoice date

    Hello community... I came back again. Can someone help me with my system. What happened is.. We sell yearly service. Let's say client bought service 01/04/2018 And his next due date is 31/03/2019. Now system generate invoice on 15/03/209 But he didn't paid. He decide to pay on may.. I knw the service will be suspended. But it's not a problem. Now if he pay on may .. I see his next due date will be 31/03/2020 not 01/05/2020 So he is loosing a month when he didn't used the service in April. Can we have a hook to update the next invoice date the customer paid+365 days? Please help me
  4. Favicon manager module lets you add a favicon image to your WHMCS website. Favicon is a small icon image or logo displayed in the address bar of a web browser. By using this Module, you can easily upload and change favicon icon on your WHMCS. You can create favicon icon for each page or only use one favicon icon The favicon manager module is free. You can download the favicon manager module from the product page. The favicon manager module is encoded with ionCube if you want the source code you can buy from the product page Favicon Manager Module Features Very simple and easy to use. No complex menus or setting. Just upload an image and change your website's default favicon logo. Enable or disable the favicon on the website. Create favicon icon for each page on the website. Compatible with WHMCS version 6.x.x View the product Page View all our works and Products
  5. Hello I use OrderDomainPricingOverride hook to change some domain price manually, I need two registrars to use this hook, but when I add hook file to the second registrar's folder I get blank page and the whole site shuts down. I don't use any registrar function in the file, I just check domain's sld and tld and generate price, how can I manage to use the hook for both registrars ? this is my whole hook file: <?php /** * WHMCS SDK Sample Registrar Module Hooks File * * Hooks allow you to tie into events that occur within the WHMCS application. * * This allows you to execute your own code in addition to, or sometimes even * instead of that which WHMCS executes by default. * * WHMCS recommends as good practice that all named hook functions are prefixed * with the keyword "hook", followed by your module name, followed by the action * of the hook function. This helps prevent naming conflicts with other addons * and modules. * * For every hook function you create, you must also register it with WHMCS. * There are two ways of registering hooks, both are demonstrated below. * * @see https://developers.whmcs.com/hooks/ * * @copyright Copyright (c) WHMCS Limited 2016 * @license https://www.whmcs.com/license/ WHMCS Eula */ // Require any libraries needed for the module to function. // require_once __DIR__ . '/path/to/library/loader.php'; // // Also, perform any initialization required by the service's library. /** * Register a hook with WHMCS. * * add_hook(string $hookPointName, int $priority, string|array|Closure $function) */ add_hook('AdminHomeWidgets', 1, function() { return new SampleRegistrarModuleWidget(); }); add_hook('OrderDomainPricingOverride', 1, function($vars) { // Perform operations to determine price // logActivity('OrderDomainPricingOverride 900', 0); $domain = explode('.', $vars['domain']); $sld = $domain[0]; $tld = '.' . $domain[1]; $domain_name = explode('.', $vars['domain']); if(count($domain_name)==2 && strlen($domain_name[0])==2 && $domain_name[1]=='ge'){ return 900.00; } }); /** * Sample Registrar Module Admin Dashboard Widget. * * @see https://developers.whmcs.com/addon-modules/admin-dashboard-widgets/ */ class SampleRegistrarModuleWidget extends \WHMCS\Module\AbstractWidget { protected $title = 'Sample Registrar Module'; protected $description = ''; protected $weight = 150; protected $columns = 1; protected $cache = false; protected $cacheExpiry = 120; protected $requiredPermission = ''; public function getData() { return array(); } public function generateOutput($data) { return <<<EOF <div class="widget-content-padded"> Your widget output goes here... </div> EOF; } }
  6. Hello All, I am trying to following part of code within the viewinvoice page but the paymentbutton is not updated. Is the smarty->assign option still supported? <?php function custom($vars) { global $smarty; if ($vars['filename'] == 'viewinvoice' && $vars['status'] == 'Unpaid') { $smarty->assign('paymentbutton', "BG"); } } add_hook('ClientAreaPage', 1, 'custom'); ?> The hook seems to run but the paymentbutton is not updated. Does anyone have the same issue? How can we update the paymentbutton?
  7. Hello, I have built a hook to show a new navbar, but I want it to hide to not logged in members. Is this possible? Thank you My hook im using: <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimaryNavbar', 1, function (MenuItem $primaryNavbar) { $primaryNavbar->addChild('Tools') ->setOrder(50); $primaryNavbar->getChild('Tools') ->addChild('Html Tester') ->setUri('/html.php') ->setOrder(1); $primaryNavbar->getChild('Tools') ->addChild('Privacy Policy Generator') ->setUri('/privacypolicygenerator.php') ->setOrder(2); $primaryNavbar->getChild('Tools') ->addChild('cPanel Backup Generator') ->setUri('/backup.php') ->setOrder(3); });
  8. We are trying to include a productID into a tracking link so we can include the product which was purchased. A hook is required for it and we require someone who can write a simple one. Example of the complete.tpl link: <img src="https://trackingurl.com/ep?ord={$ordernumber}&orderid={$orderid}&product={$THISISMISSING}&qlist={$smarty.session.orderdetails.Products|@count}&amtlist={$amount*100}&cur=USD&img=1"> Thank you!
  9. Hi, I am trying to add a link tot he affiliate login page under the account menu section. Just like the log in hook for the main section. I would like it to be under the: login register lost password (Affiliate Login) Thanks for any help. I've checked the TMSecondaryNavbar.php file but can't see what to add. I tried to add this: $primaryNavbar->getChild('Company') ->addChild('Affiliate Login', array( 'uri' => 'affiliates.php', 'order' => '20', )); But it crashed the whole site. Thank you, Charles
  10. battles

    A-Record by product.

    I'm in need of setting an A-record to a specific IP when certain set of products is ordered. Enom and using their API. Would I create a hook?
  11. Hey guys! I was unable to find a good way of updating bitcoin currency rates so I decided to create my own module to do this for me and that resultet in Anveto Currency Rates. This addon will update additional currency rates when the daily cron runs or when Anveto cron runs (see downloads here for anveto cron https://anveto.com/members/downloads/2/WHMCS) in order to update currencies multiple times daily. Currently it uses the bitpay (https://bitpay.com/api/rates) to get currency rates but you could set this to any source as long as it follows the same json format. The module costs $10 and can be purchased here https://anveto.com/members/cart.php?a=add&pid=21 It is currently pending community app store review. The source code is not encrypted as I want users to be able to modify this however they would like as long as they purchase the module. I hope some of you find it useful!
  12. How can I show the clients first and last name in a support ticket hook. I got everything else working such as userid, message, and subject. But I can't get the first and last names to show. I tried $firstname and $lastname as a varible but it doesn't show.
  13. Good morning, We created a WHMCS provisioning module for our control panel. Because in our control panel, the usernames match the domain names, we added a hook which overrides the username that is automatically generated by WHMCS when an order is being placed. The hook look as follow: /** * Replace generated username by domain name */ add_hook('OverrideModuleUsernameGeneration', 1, function ($vars) { if($vars['moduletype'] != 'imscp') { return null; } return $vars['domain']; }); This works well for products that are setup automatically (the hook is run as expected and the username is set with the domain name as expected). However, when the order is placed and accepted manually, or when the product setup is not automatic, the hook is not triggered and thus, the username is not overriden. We already reported the issue to WHMCS team (#AMI-418461 no answered yet) but it would be great if someone here could help us to find a temporary workaround. The hook should be triggered in every contexts (when our provisioning module is involved). To resume, each time the username is being generated, that hook should be called. Thank you for your help. Involved WHMCS version: 6.3.1
  14. What I am trying to do is to add a hook where variables are send to an external page for processing via get or post. The page is on other domain and involves creating directories so te hook itself won't be able to do that. hook = get variables (userid, domain) and send to an external page. (Same server, other domain. The database can be updated from either side so it's no problem) Do anybody have some ideas please?
  15. Hello, I'm working on making it possible to show a Twitter feed based on the client. That way we can show different feeds for resellers and end-users. When someone isn't logged in I would probably show the end-user Twitter account. Changing the Twitter account for the URLs pointing to Twitter is easy. However with an AJAX (?) call it doesn't work. From WHMCS support I did hear I should be able to create some output on it when using the ClientAreaPage hookpoint. However this doesn't seem to work as the code below doesn't return any content (and that is what I would expect). <?php function whmcs_hook_test($vars){ var_dump($vars); } add_hook('ClientAreaPage',10,'whmcs_hook_test'); Any pointers as where to look? Or should I just create a new PHP file for it that gets the required information from Twitter and call that file using the Javascript?
  16. With the Login with PayPal Module, your clients can authenticate into your WHMCS using PayPal. It’s the same procedure we already know for Facebook, or maybe Twitter and GitHub. The Login with PayPal module is a commerce identity solution that enables clients to register/login into the client area quickly and securely using their PayPal login credentials. One of the most important reasons to use the module is simplicity. Your clients will not need to remember another set of credentials – the same advantage OAuth via FB, Twitter, etc have. In addition, the login procedure is absolutely secured fewer concerns for you. However, it’s not just an email and a password. Features Login form the client are login page Register form the client register page Register or login form the checkout page Connect to PayPal for existing clients from the client panel Clients register list for admin area to see all connected clients Custom buttons – you can use your own buttons style Debug mode – sandbox or live View the product Page View all our works and Products
  17. I created an action hook (almost) that will force clients to agree to new terms of service (on login) before being able to continue to client area. I created a new column under "tblclients" called "tosversion" (which is type "date" instead of a version number) and that gets updated no problem when the client logs in. The only problem is displaying a page or popup that displays the TOS before this field is updated. the code: <?php $updateddate = "2016-02-16"; function hook_tos_clientlogin($vars) { /// CHANGE YOUR TOS VERSION $updatedtosversion="2016-02-16"; $clientid = $vars['userid']; if (!filter_var($clientid, FILTER_VALIDATE_INT)) { return; } $tbl="tblclients"; $fields = "tosversion"; $where = array("id"=>$clientid); $result = select_query($tbl,$fields,$where); $data = mysql_fetch_array($result); $ctosversion = $data['tosversion']; if ($ctosversion < $updatedtosversion) { //we don't match, do something. // make sure we update at the end of this $update = array("tosversion"=>"$updatedtosversion"); $where2 = array("id"=>"$clientid"); update_query($tbl,$update,$where2); } else { //just a courtesy else } } add_hook("ClientLogin",1,"hook_tos_clientlogin"); ?> What am I missing?
  18. I am looking to delete certain gateways from a hook so that these gateways are not shown on the cart. The following code does the filtering/removal of the relevant gateways in a hook: function hook_HideGateways($vars) { global $CONFIG; if ($vars['filename']=='cart') { // delete all but securetradingadvanced from gateways array foreach ($vars['gateways'] as $gw_name => $gw) { if ($gw_name != 'securetradingadvanced') { unset($vars['gateways'][$gw_name]); // delete gateway } } } } add_hook('ClientAreaPage', 1, 'hook_HideGateways'); How can I then return/override the $gateways Smarty variable as used in the cart templates? Thanks in advance!
  19. I am trying to run ClientChangePassword hook after ClientEdit hook. BUt no matter what priority I set for them, ClientChangePassword always runs before ClientEdit! How to overcome this? Can anyone please help?
  20. We just finished updating the Admin Private Messages module to v2.0.0 to work on WHMCS v6. Note that v2.0.0 only support WHMCS v6 or later if you need the module to work on WHMCS v5 you can still use Admin Private Messages v1.6.0 Changlog Rewrite the code from scratch Support only WHMCS v6 Changed the dialog box Added send messages section Added email template editor Added send message to all staff View the product Page View all our works and Products
  21. Take advantage of our WHMCS Addons with 50% Discount during this Weekend! Offer is available to new and existing customers. The Coupon Code is: 50OFFWE Supports WHMCS v5 & v6. One Time pricing. For Screenshots, More Details and Prices please visit our WHMCS Addons page.
  22. A very important feature is missing from WHMCS, the language fallback. It's impossible to able to translate all custom stings to all languages, so best scenario is to load the default string translation, for example "english". This is the hook code of "languageFallback.php", the code seems OK but does not effect the loaded language. Any suggestion? /* Developer: Stergios Zgouletas Web-site: web-expert.gr License: GNU GPL v2 */ if(!defined("WHMCS")) die("This file cannot be accessed directly"); function languageFallback($vars){ $defaultLanguage='english'; //Fallback Language $currentLanguage=strtolower($vars['language']); //Current Active Language global $_LANG; $current=$_LANG; if($defaultLanguage!=$currentLanguage){ //Load default language file $default=array(); if(file_exists(ROOTDIR.'/lang/'.$defaultLanguage.'.php')){ require(ROOTDIR.'/lang/'.$defaultLanguage.'.php'); $default=$_LANG; } //Load default override language file $defaultOverride=array(); if(file_exists(ROOTDIR.'/lang/overrides/'.$defaultLanguage.'.php')){ require(ROOTDIR.'/lang/overrides/'.$defaultLanguage.'.php'); $defaultOverride=$_LANG; } //Load module's language $module=array(); if(isset($_REQUEST['m']) && !empty($_REQUEST['m']) && file_exists(ROOTDIR.'/modules/addons/'.$_REQUEST['m'].'/'.$defaultLanguage.'.php')){ require(ROOTDIR.'/modules/addons/'.$_REQUEST['m'].'/'.$defaultLanguage.'.php'); $module=$_ADDONLANG; } $_LANG=array_merge($default,$defaultOverride,$module,$current); return array('languageFallback'=>1); } return array('languageFallback'=>0); } add_hook("ClientAreaPage",0,"languageFallback");
  23. V6.01 I have a hook menu.php It is working to do what I wanted, add an item to the support menu and remove the downloads item. Cool! But when logging out from the client area it throws an error. "Fatal error: Call to a member function addChild() on a non-object in /home/steved/public_html/includes/hooks/menu.php on line 9" This implies that when someone is logging out and logout.php is being loaded, it is calling the menu hook. Reloading logout.php then redirects to index.php When logout.php is being called, by that time the $ca->isLoggedIn() flag should be false shouldn't it? So it shouldn't even see the code throwing the error. Or am I completely missing the point somewhere? $ca = new WHMCS_ClientArea(); use WHMCS\View\Menu\Item as MenuItem; if ($ca->isLoggedIn()) { add_hook('ClientAreaPrimaryNavbar', 1, function (MenuItem $primaryNavbar){ /** Add Create Ticket to the Support Menu **/ $primaryNavbar->getChild('Support')->addChild('Firewall Management', array( 'label' => 'Open a Ticket', 'uri' => 'https://domain.com/submitticket.php', 'order' => '1', )); }); add_hook('ClientAreaPrimaryNavbar', 1, function (MenuItem $primaryNavbar) { if (!is_null($primaryNavbar->getChild('Support'))) { $primaryNavbar->getChild('Support')->removeChild('Downloads'); } }); }
  24. I am having an issue where my the hook for the DailyCronJob is not being called. I know cron is running as I get the email daily. It seems like the method is not being called to perform the update but if I call this from the browser it seems to work fine. What am I missing or doing wrong here? class MyAddon_Hooks { protected static $instance = NULL; public static function get_instance() { if ( NULL === self::$instance ) self::$instance = new self; return self::$instance; } function __construct() { $files = array("addonfile.php"); foreach ($files as $f) { if (file_exists($f)) { include_once($f); } } } function update() { Anveto::get_instance()->cron(); } } function myaddon_update() { MyAddon_Hooks::get_instance()->update(); } add_hook("DailyCronJob",1,"myaddon_update"); This is the code in my hooks.php file.
  25. Ok, so I have a hook in place for ShoppingCartCheckoutCompletePage. When they reach completion page, hook checks for products in the order and based on product ID and if order status is pending, it sends out a correct email. Because I'm using ShoppingCartCheckoutCompletePage hook, the email should go out right there and then when order is complete. So why does the email go out when dailycron runs in the morning? Thoughts? I'm using internal API inside hook to sendmail with a correct template.

Important Information

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