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


WHMCS.Community

  • The latest WHMCS Release
  • WHMCS Beta Program
    • WHMCS Mobile App Technical Preview Feedback
  • The Latest from the WHMCS Team
    • News, Announcements & Blogs from WHMCS
  • 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 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
    • Feedback
    • 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
  • Katamaze's Free Scripts
  • Katamaze's Modules
  • Zomex Club's Topics
  • 0100Dev Club's Topics

WHMCS Version

  • V8.1.x Hotfixes
  • V8.0.x Hotfixes
  • V7.10.x Hotfixes
  • V7.9.x Hotfixes

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


About Me

Found 38 results

  1. Hi, Can someone please help me with this hook? It was created by @brian! and appeared here- but sadly he can't help me. Since I'm selling mostly one time products - I have lots of inactive clients and I want to be able to find them easily without the hassle of changing the search toggle. There it this feature request that was opened 2 years ago to make the hide inactive clients optional (please vote) - but until this happens I have no choice but to use this hook: <?php add_hook('AdminAreaHeadOutput', 1, function($vars) { if ($vars['filename'] == 'clients' OR in_array($vars['pagetitle'], array(AdminLang::trans('services.title'), AdminLang::trans('services.listaddons'), AdminLang::trans('services.listdomains')))) { $autoPost = <<<HTML if ($('input#checkboxShowHidden').is(':checked')) { $('body').addClass('hidden'); $('#checkboxShowHidden').click(); } HTML; } return <<<HTML <script> $(document).on('ready', function() { if ($('input#intelliSearchHideInactiveSwitch').is(':checked')) { $('#intelliSearchHideInactiveSwitch').click(); } {$autoPost} }) </script> HTML; }); The problem with this one is that the search bar is always opened with this error - in every page loading: So even If i'm not clicking on the search field - the search bar is opened with this message. Can someone help me figure out what should be changed in this hook file so it will not open the search bar automatically - but when we do search we will see the inactive clients alongside the active onse? Thanks!
  2. Hello, is there anyway via hook or modifying the php to add images before X configurable option name? Example:
  3. We have two credit card processors. One is only for existing customers and one is for new sign ups. I was wondering if we could disable a processor just in the public checkout, but still have it for existing customers that have a product. Basically disable a processor in the main checkout, then have it when adding products after the customer has a product.
  4. sometimes the client can have 2 emails. one for your account details and one for the account owner. I need to know if the account owner's email is verified. The var: $client = Menu::context("client"); gets the email that the customer has in the account details, however this is not the email owner of the account. I hope to make myself understood correctly.
  5. Hello, I am new to this community! I am setting up a hook that allows me to pass new client data to Zapier in order to update our Marketing automation software. This is the code I have been testing now: add_hook('ClientAdd', 1, function ($vars) { $userid = $vars['userid']; $firstname = $vars['firstname']; $lastname = $vars['lastname']; $email = $vars['email']; $phone = $vars['phonenumber']; $city = $vars['city']; $country = $vars['country']; $postcode = $vars['postcode']; $company = $vars['companyname']; $state = $vars['state']; $params = '?userid='.$userid.'&firstname='.$firstname.'&lastname='.$lastname.'&email='.$email.'&phonenumber='.$phone.'&city='.$city.'&country='.$country.'&postcode='.$postcode.'&companyname='.$company.'&state='.$state.'&source=WHMCS'; $url = 'https://hooks.zapier.com/hooks/catch/zzz/rrrr/'.$params; $options = array( 'CURLOPT_POST' => 0 ); $response = curlCall($url,$postfields,$options); logActivity('logged addClient with params: ' . $params . 'following is the result: ' . $request, $userid); }); I also tried to send this via file_get_contents but it does not seem to work, by composing the url together with real world values gotten from the LOG in the admin area the request works on Zapier's end, I suppose that the problem lies within WHMCS and the request. The Zapier request has been altered for privacy reasons. Can anyone point me in the right direction?
  6. I think the title already say everything. I've been searching on forums, github and other places but I didn't found anything that is working. Can someone help me?
  7. Hello again! The title says everything. I found a hook on github but it's not working so I'm here to ask for help 😊 I hope this topic help a lot of people.
  8. Hi all, i'm newbie with whmcs and i need help to solve a problem. I'm working with whmcs v. 7.x and actually ( not even in 8.x ) there's a way to change hosting price after 1 year, without creating and using a promotional coupon code . So i need that one of my product hosting with pid=70 that it's price 20.00$ could be changed automatically to 30.00$ in Recurring Amount after 1 year. For only client he's buying it. So after client have bought it and paid invoice, hook could work and update Recurring Amount value in hosting product for client...There's a way to perform it with a hook ? I'm seeing documentation about whmcs hooks and i found the " OrderPaid " . Something below could be works? <?php add_hook('OrderProductPricingOverride', 1, function($vars) { $return = []; if ($vars['pid'] == 70 { $return = ['recurring' => '30.00',]; } return $return; }); Thanks for any help.
  9. Hello Everyone. hope all are fine. can someone help me to modify this code a little so i can achieved what i am looking for. basically i have hook file for a client custom field. what the hook does is when i create a new customer its create a random 8 digit number for the custom field Account Number. its fine until now but the problem is 1. This hook doesn't check the existing value in the database , so there is chance to create the duplicate account number and we cant allocate same account for two customer. 2. once the Account created and we have the account number then any admin or staff can modify the client details form and easily change the account number. and this is another dangerous point. we cant change the account number for any customer. once we create the customer we will have permanent account number for that customer. so what can i do in this case with this hook? i have given the code in here. thanks again in advance <?php use Carbon\Carbon; if (!defined("WHMCS")) die("This file cannot be accessed directly"); function AccountNumber($vars) { $userid = $vars['userid']; $command = 'UpdateClient'; $values = array( 'clientid' => $userid, 'customfields' => base64_encode(serialize(['Account Number'=>rand(11111111,99999999)])) ); $results = localAPI($command, $values); if ($results['result'] == 'success') { logActivity('Success : Customer ID set successfully to User # '.$userid); } else { logActivity('Error : Customer ID could not be set to User # '.$userid.'. Response : '.$results['result']); } } add_hook("ClientAdd",1,"AccountNumber");
  10. Hi, I want to perform some tasks that require the service id on a hook(specifically invoice creation) the paramters there are limited all I get is the invoice id. Is there a way to fetch service id using that invoice id any indication/help/solution would be highly appreciated. The hook must trigger either before or after invoice generation. Thanks. 👍
  11. dear community member.. hope all doing very well. i am trying to make a module for my VoIP project . one of my friend helping me out in this module. but i dont know what he done something is he can't figure out how to fix. basically its for VoIP project. so we will sell voip service with local city number. so when the ordering time we will select the city and then based on the city name the available numbers will be display.. so for the list of city the api link is https://mydomainname.com/api/city_list.php?&token=123456 this api link display all the city name from remote database so thats i want it to show in one custom field and for the second custom field based on the city name i have another api link which is https://mydomainname.com/api/did_free.php?city=Dublin&token=123456 which shows result this way its only shows the number is dublin city from the remote database. my friend make the module for me. but the way i want its show very right in the customer order form . i mean if customer directly buy from the client area its shows perfect according to city name so when i select the city then i see available numbers based on the city which the way i wanted to see from the client area. so from the client area its works properly no problem. problem with from the admin area when i wanted to setup a product to client from admin in the admin panel i see like this which means its doesn't matter which city i select. but i see all numbers from my remote database. like 35391 is Galway numbers 35314 is Dublin Numbers and 35321 is Cork numbers. they are all showing together. which is very frustrating . here is my hook file code. can some please please tell me where he did wrong? HOOK FILE CODE ======================================== <?php use PDO; use Exception; use PDOException; use WHMCS\Database\Capsule; $host = 'https://mydomainname.com/api/'; $token = '123456'; $ch = curl_init(); $fields = array( 'token' => $token ); curl_setopt($ch, CURLOPT_URL, $host.'city_list.php?'.http_build_query($fields)); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $city = curl_exec($ch); curl_close($ch); $packageNames = json_decode($city, true); $citylist = array(); $numberslist = array(); foreach ($packageNames['result'] as $packageName) { $citylist[$packageName['city']] = ucfirst($packageName['city']); $ch = curl_init(); $fields = array( 'city' => $packageName['city'], 'token' => $token ); curl_setopt($ch, CURLOPT_URL, $host.'did_free.php?'.http_build_query($fields)); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $numbers = curl_exec($ch); $numbers = json_decode($numbers); $numberslist = array_merge($numbers->result,$numberslist); curl_close($ch); } $citylist = implode($citylist,','); $numberslist = implode($numberslist,','); //echo json_encode(array('cities'=>explode(",",$citylist),'numbers'=>explode(",",$numberslist))); $pdo = Capsule::connection()->getPdo(); try { $result = $pdo->query( "update tblcustomfields set fieldoptions = '".$citylist."' where fieldname = 'City'" ); } catch (\Exception $e) { echo "Uh oh! {$e->getMessage()}"; return $e->getMessage(); } try { $result = $pdo->query( "update tblcustomfields set fieldoptions = '".$numberslist."' where fieldname = 'Available Phone Numbers'" ); } catch (\Exception $e) { echo "Uh oh! {$e->getMessage()}"; return $e->getMessage(); } add_hook('OverrideModuleUsernameGeneration', 1, function($vars) { return $vars['customfields']['Available Phone Numbers']; }); ============================================================= please someone help me to correct the code. please
  12. Hello, I am trying to create a hook for adding a new element in sidebar. I have created the hook. add_hook('ClientAreaPrimarySidebar', 1, function($primarySidebar) { /* @var \WHMCS\View\Menu\Item $primarySidebar */ $newMenu = $primarySidebar->addChild( 'accountmanager', array( 'name' => 'Home', 'label' => Lang::trans('account_manager'), 'order' => 1, 'icon' => 'fas fa-life-ring', ) ); $newMenu->addChild( 'accountmanager', array( 'label' => Lang::trans('account_manager_label'), ) ); }); I am trying somehow to get the userid, and assign it to a variable. And is it possible to be used in translations? I tried with this one here but it's not working: $variable = $template->getVariable('variablename')->value; $template->assign('variablename ', 'variable');
  13. 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.
  14. 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 🙂
  15. 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
  16. 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
  17. 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; } }
  18. 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?
  19. 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); });
  20. 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!
  21. 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
  22. 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?
  23. 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!
  24. 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.
×
×
  • 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