Jump to content

Search the Community

Showing results for tags 'hooks'.



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 52 results

  1. Dear All, I want to show the Next Invoice Date under Next Due Date when admin access Page Client Details on Product/Services Tab. But, I've no idea how to show it, I just know to get the Next Invoice Date value related from tblhosting Anyone can help me to show it ? Thank you. <?php use WHMCS\Database\Capsule; add_hook('AdminClientServicesTabFields', 1, function($vars) { $PID = $vars['id']; $nextinvoicedate = Capsule::table('tblhosting')->where('id', $PID)->pluck('nextinvoicedate'); $result = array(); $result['nextinvoicedate'] = $nextinvoicedate; return $result });
  2. Hi all, I wish to perform some registrar API activities in the registrar hooks, but as the hook's vars or params didn't provide credential details, I tried to get direct from DB Capsule and unfortunately noticed the data stored in encrypted format... Any suggestions to over come this? TQ. Best Regards, Nelson
  3. Hello, I am working on a custom hook and I find that just by adding an input field of type Tel, the country code is added by WHMCS. I am basically showing a modal from my hook if a condition is met. Now I am testing the example code on the IntlTelInput plugin website (https://intl-tel-input.com/node_modules/intl-tel-input/examples/gen/default-country-ip.html) $(document).ready(function(){ var input = document.querySelector("#phone"); window.intlTelInput(input, { initialCountry: "auto", geoIpLookup: function(callback) { $.get("https://ipinfo.io", function() {}, "jsonp").always(function(resp) { var countryCode = (resp && resp.country) ? resp.country : "us"; callback(countryCode); }); }, }); }); <input type="tel" id="phone"> But that's returning an error: I basically want to sow the local country code in the form. is there a way to achieve this? bearing in mind that I am not in the tpl file, just echoing a modal from my hook.
  4. Dear All, My Product setting Configuration Prorate Date: 1 Charge Next Month: 32 So, every product that client buy will have Next Due Date value on tblhosting 01/mm/yyyy on each month My Goal: I want to make all Invoices that created by automatic cron (recurring invoice, etc) and publish to client have a duedate value 10/mm/yyyy The Next Due Date from tblhosting do not need to be change, because I need the product period date is 1 until the end of the date of that billed month. Is it possible to do that by create Hooks ? If yes, which Hooks variable that I need to use to achieve it ? If due date value from tblinvoices can be overwrite by hook, does the invoice reminder cron will follow the new due date ?
  5. 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.
  6. Hi Community, I have been trying to figure something out for a while now and am at the end of the road. We have a block of JavaScript which we wish to execute on any page where the user has got a certain product active. If they don't have the certain product, nothing should happen, but if they do, I want the JavaScript to execute. I was thinking that a hook might be the best way to accomplish this, but I am unsure of how to make this work? Any suggestions or ideas would be massively appreciated. Many thanks, Sam
  7. 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?
  8. Hi, I've been unable to find other posts on the topic, should there be any I am sorry for posting. I am looking for a way to place orders that will be flagged as fraud. This is in order to test some post fraud check hooks. I have tried Maxmind/Fraudlabs with bogus zip codes, hotmail email, high risk countries. Orders just pass trough as OK. If anyone has any suggestions as to triggering fraud check with automatic listing as fraud-order please share. Setting a order to fraud manually is not an option, as certain hooks does not trigger with this behavior. Cheers
  9. Hello, I am creating a module for invoice to display data from database. I want to know how to add that fetch value from module to invoice using hooks.
  10. how to get user request module info into modules hook folder structure: mymedia | | +---- hooks.php +---- mymedia.php +---- index.php created products: product-01: product-02: ------------------- ------------------- | Name: media 01 | | Name: media 02 | | Module: mymedia | | Module: mymedia | | | | | |_________________| |_________________| here, TableName: tblproducts ----------------------------------------------------- | id | name | servertype | ...... | ------------------------------------------------------- | 1 | media 01 | mymedia | ...... | | 2 | media 02 | mymedia | ...... | | .. | ........... | ....... | ...... | ----------------------------------------------------- hooks.php: <?php add_hook("AcceptOrder", 0, "mymedia_acceptOrder"); function mymedia_acceptOrder() { // how to get request product id or name here $mediaIDorName = ?? } ?> NB: how to get user request module info into modules hook.
  11. Hello! I'm using Lang::trans within a php hook for EMailPreSend. I set 'credited' in each language override file: $_LANG['locale'] = "en_GB"; $_LANG['credited'] = "has been credited"; and $_LANG['locale'] = "ro_RO"; $_LANG['credited'] = ": tranzacția a fost creditată"; Then, in the hook: $merge_fields = []; $paymentMethodTitle = "Bank Transfer"; $newSubject = $paymentMethodTitle.' '.Lang::trans('credited'); $merge_fields['custom_subject'] = $newSubject; $vars = array_merge( $vars, $merge_fields ); return $vars; In the Email Template, the subject is {$custom_subject}, which shows $newSubject variable just fine. But I guess Lang::trans doesn't use the client's language. The email template (body) uses the client's language without issue, but ... how in the world do I get Lang::trans in EMailPreSend to use the client's language? I just want the client's language to be used when sending the client an email (call me silly!). Thanks for any clues!
  12. Hi, Just trying to get some insight on adding a shopping cart icon like on this image to the WHMCS main menu. blog.webhost.pro/wp-content/uploads/2015/11/cart.jpg I can add hooks, I just have no idea how to add a hook next to the menu "account" drop down link. I also am not sure how to add an icon with a number to show how many items are in the shopping cart. I am willing pay for help as well. Any insight will help me. Thanks so much for your time. Charles
  13. I am trying to remove the sidebar menu "Actions" from the My Products and Services page. I have created the following hook: ``` <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimarySidebar', 1, function(MenuItem $primarySidebar) { if (!is_null($primarySidebar->getChild('My Services Actions'))) { $primarySidebar->removeChild('My Services Actions'); } }); ``` But it is not removing the sidebar from the page /clientarea.php?action=services What am I doing wrong? Thanks, Steve
  14. Following a question from @Mauwiks... natively in WHMCS, there is no way to do this - but with the help of the attached hook, it is possible - just upload the hook to /includes/hooks the hook currently includes EIGHT different parameter options - I can think of at least 4 more options that I could add, and may do so at a later date, but I think 8 is plenty to be going on with. 🙂 note: the addon's ID value can be found when in the URL when you edit that product addon in the admin area - configaddons.php?action=manage&id=1 Linking to one specific product addon cart.php?gid=addons&id=1 Linking to Market Connect product addons by brand cart.php?gid=addons&id=codeguard cart.php?gid=addons&id=sitelock cart.php?gid=addons&id=spamexperts cart.php?gid=addons&id=ssl cart.php?gid=addons&id=weebly these addons are found by the hook searching whether specific terms are found at the START of the product addon descriptions, e.g Codeguard etc Linking to multiple product addons cart.php?gid=addons&multi[]=1&multi[]=32&multi[]=54 Linking to a predefined group of product addons cart.php?gid=addons&id=group1 $group1 is a predefined array of product addon IDs that you can edit in the hook.. $group1 = array(12,28,20); you could, in theory, have multiple groups (arrays of addon IDs) predefined in the hook, but it's currently only coded for 1 group - but it would be simple enough to change. if you pass a numeric addon ID value that doesn't exist for the particular client, then you'll get the no addons available error message... ... I did toy with the idea of showing all addons under those circumstances, but I decided against it for now - not least because it keeps the coding simplified! 😉 if you pass an undefined non-numeric id, e.g cart.php?gid=addons&id=brian, then there is nothing for the hook to remove and it will show all addons as per normal. you can only use one parameter option in a URL - e.g., you can't use cart.php?gid=addons&id=43&multi[]=32 addons_mauwiks.php
  15. Hello everyone, My requirement is that let's say I have one configuration option called "personal computer" which is text box. User will fill 1, 2, 3, etc... When they check out ("Click to Continue" button), I need to check one value from my another site by calling web service. Eg. If they fill 3 and result from another site is less than 3, they cannot check out. My problem is I don't know whether there is a hook that run before user can checkout. I had tried following hooks but still can't find the solution. 1) ShoppingCartValidateProductUpdate, 2) ShoppingCartValidateCheckout 3) ShoppingCartValidateProductUpdate 4) ShoppingCartValidateCheckout 5) PreShoppingCartCheckout 6) PreCalculateCartTotals Most of them are not working, or, I don't know when will they fire. Please help me. Is this possible to achieve? Or is there any work around to achieve this? Thanks in advanced tslin
  16. Starting from the code provided by @brian! in this post: I realized a pop-up system which shows every time user log-in, but once a day (that's to say: if the user login 5 or more times in a day, the pop-up shows just one time, in order not to annoy him) The pop-up shows to the user his previous log-in time, and one "trick of the day" (randomly chosen one) (IMHO, "trick of the day" is a great way to spread knowledge and marketing news without annoying the user) The code, in form of a hook (note: line #35 is for testing purposes only: remove or comment it): <?php //Show modal popup to clients, with a welcome message and a random trick of the day //original code by brian! , modified by Remitur function client_custom_headoutput_hook($vars) { $head_return = ''; $head_return = '<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-cookie/1.4.1/jquery.cookie.min.js"></script> <script> $(document).ready(function() { $(\'#myModal\').appendTo("body"); function show_modal(){ $(\'#myModal\').modal(); } window.setTimeout(show_modal, 100); $(".dismiss").click(function() {}); }); </script>'; return $head_return; } add_hook("ClientAreaHeadOutput",1,"client_custom_headoutput_hook"); use Carbon\Carbon; function client_custom_headeroutput_hook($vars) { $client = Menu::context('client'); $lastlogin = Carbon::parse($client->lastLoginDate); $enddate = Carbon::parse($client->lastLoginDate)->addDays(1); // next line is just for testing purposes: remove it! $enddate = Carbon::today(); $today = Carbon::today(); $templatefile = $vars['templatefile']; if (empty($client->id)) { return; } if ($today >= $enddate and $templatefile == "clientareahome") { $header_return = ''; $header_return = '<div class="container"> <div class="modal fade" id="myModal" role="dialog"> <div class="modal-dialog modal-md"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">×</button> <h4 class="modal-title"><i class="fa fa-thumbs-up fa-lg"></i> '.Lang::trans('hello').', '.$client->firstname.'</h4> <p>Your last login has been '.$lastlogin.'</p> </div> <div class="modal-body"> <p>Trick of the day:</p> <p>'.Lang::trans ('tricks.'.rand(1,13)).'</p> </div> <div class="modal-footer"> <button type="button" class="btn btn-primary dismiss" data-dismiss="modal">'.Lang::trans('orderForm.close').'</button> </div> </div> </div> </div> </div>'; return $header_return; } } add_hook("ClientAreaHeaderOutput",1,"client_custom_headeroutput_hook"); The tricks are provided as an array of language variables; here there're 13, I guess that 30 is the minimum reasonable number; more is better. In the tricks you can provide also internal and external links (just one here for example): #====================== tricks for popup ============================================ $_LANG['tricks']['1'] = "On DomainRegister you can register your own .com.br domain even if you have not a headquarter in Brazil"; $_LANG['tricks']['2'] = "Interface on DomainRegister is available in three different languages (English, Italian and Slovenian): select your preferred one using the flags in the upper right corner "; $_LANG['tricks']['3'] = "On DomainRegister you can renew any domain up to 10 years in advance (even those for which a multi-year renewal is not envisaged)"; $_LANG['tricks']['4'] = "If you manage a large number of domains, on DomainRegister you can create one or more DNS templates, to quickly implement complex DNS configurations for each single domain "; $_LANG['tricks']['5'] = "Using wildcard SSL certificates, with a single SSL certificate you can secure both your main domain and an unlimited number of subdomains on any number of different servers"; $_LANG['tricks']['6'] = "<a href=\"https://domainregister.international/dns-service.php\" target=\"_blank\">DomainRegister's DNS service</a> (which is free for any domain registered through us) got 100% uptime... since 2011!"; $_LANG['tricks']['7'] = "If you change the data of the registrant of a .com domain, you cannot transfer the domain for 60 days (sixty days lock)"; $_LANG['tricks']['8'] = "With DomainRegister's Linux Pro hosting plan, you get your own, dedicate european IP for your site"; $_LANG['tricks']['9'] = "DomainRegister's StarterMail starts with 5 email addresses and 5 GB archive space, and may be expanded up to 25 email addresses and 25 GB archive space; larger solutions are available upon request"; $_LANG['tricks']['10'] = "Keep your domains and services safe by protecting them with 2FA authentication: on DomainRegister it's free!"; $_LANG['tricks']['11'] = "trick 11"; $_LANG['tricks']['12'] = "trick 12"; $_LANG['tricks']['13'] = "trick 13"; Any idea to improve this hook is welcome!
  17. Hi! Does anybody know how I can change this: To this: Either via a hook or in what template do I need to look for this? (I'm also using the Lagom theme)
  18. In the latest release, you may have noticed that the Request Cancellation link in the left sidebar has been removed for free and one time products and services. This change was made in response to a bug report relating to one time products not being automatically cancelled. There was some concern that allowing cancellation requests for free and one time items, which have no next due date, and therefore terminate immediately on the following cron run could lead to irrevocable data loss. It is important to note that this is only a visual change that removes the link to submit a cancellation request. Submitting a cancellation request for a free service is still possible. If you wish to restore the option to cancel free products, you can do so using a hook. I've prepared some sample code that uses the ClientAreaPrimarySidebar hook point to achieve this. Here is the code below: <?php /** * This hook restores the Request Cancellation sidebar option on free services * * @author WHMCS Josh * @see https://developers.whmcs.com/hooks-reference/client-area-interface/#clientareaprimarysidebar * @see https://developers.whmcs.com/advanced/db-interaction/ */ use WHMCS\Database\Capsule; use WHMCS\View\Menu\Item; add_hook('ClientAreaPrimarySidebar', 1, function($primarySidebar) { // Get the handle for the Service Details Overview sidebar $serviceDetailsOverview = $primarySidebar->getChild('Service Details Overview'); // Make sure the handle is not null if (!is_null($serviceDetailsOverview)) { // Make sure the ID is available if (!empty($_REQUEST['id'])) { $serviceId = (int) $_REQUEST['id']; // Check if this is a free service $billingCycle = Capsule::table('tblhosting') ->where('id', $serviceId) ->value('billingcycle'); if ($billingCycle === 'Free Account') { // Add the cancellation request menu item for the service to the sidebar $serviceDetailsOverview->addChild( 'freeServiceCancellationRequest', [ 'name' => 'CancellationRequest', 'label' => 'Request Cancellation', 'uri' => '/clientarea.php?action=cancel&id=' . $serviceId, 'order' => 90, ] ); } } } }); To install this, you can simply add the code to a file in your /includes/hooks directory such as /includes/hooks/free_product_cancellation_request.php. For convenience, I've attached the completed hook file to this post here: free_product_cancellation_requests.php Below is also a screenshot of how this looked on my test installation of WHMCS 7.7.0. Please note that this is being provided only as an example and is not guaranteed to work with future versions of WHMCS. Feel free to modify it to suit your needs and I hope it helps!
  19. So I'm working with the licensing addon, and attempting to figure out the hook part.. add_hook('LicensingAddonVerify', 1, function($vars) { return [ 'Hash' => 'Hash Here', ]; } ); The hash actually shows in the license how it should, but I'm trying to do it since I make several softwares, and not only one, so what I'm trying to do is something like if ($productid == "prodID number") { add_hook('LicensingAddonVerify', 1, function($vars) { return [ 'Hash' => 'Hash Here', ]; } ); } else -- run get different product It doesn't retrieve the product id at all.. What am I missing here? The hash is basically there to tell the system if a new version has been released. Thanks
  20. I need to get rid of the date when I add files on the admin side. when I upload a file the a clients account in the admin section, it displays in the client area and it time stamps it. how can I remove the time stamp? OR remove the whole hook and add it back with my own var? <?php use WHMCS\View\Menu\Item; add_hook('ClientAreaHomepagePanels', 1, function (Item $homePagePanels) { $homePagePanels->removeChild('your files:dateadded'); });
  21. I found an older post regarding this but I wanted to post a working hook that adds recaptcha to the checkout page. I think this a great thing especially if you're being bombarded with fake accounts and orders. /includes/hooks/checkout-recaptcha.php: <?php if (!defined("WHMCS")) die("This file cannot be accessed directly"); function limitOrders($vars) { $url = 'https://www.google.com/recaptcha/api/siteverify'; $privatekey = "YOUR_RECAPTCHA_SECRET_KEY_HERE"; $response = file_get_contents($url . "?secret=" . $privatekey . "&response=" . $_POST['g-recaptcha-response'] . "&remoteip=" . $_SERVER['REMOTE_ADDR']); $data = json_decode($response); if (isset($data->success) AND $data->success == true) { // everything is ok! } else { $pm = $vars['paymentmethod']; if ($pm == "paypalpaymentspro") { global $errormessage; $errormessage.= "<li> Please, confirm that you are not a robot! <br/></li>"; } //if CC } } //function add_hook("ShoppingCartValidateCheckout", 1, "limitOrders"); Change YOUR_RECAPTCHA_SECRET_KEY_HERE to your the recaptcha private/secret key Google gives you. I'm using for my credit card checkout which is "paypalpaymentspro" but you can use it for any payment method. I think you really only need if you accept credits though. To get your payment method view source on the checkout page and search for "paymentmethod" your payment method will be near this. In your checkout.tpl file you also need to add somewhere under the "Complete Payment" button: <div class="g-recaptcha" data-sitekey="YOUR_RECAPTCHA_PUBLIC_KEY_HERE"></div> Replace YOUR_RECAPTCHA_PUBLIC_KEY_HERE with your public recaptcha key provided by Google. This is tested working on WHMCS v7.5.1.
  22. When it comes time to order a hosting plan, sometimes you don't want your users to be able to enter in a subdomain when using an existing domain for their order. In this post I am going to walk you through a basic hook that prevents entering a subdomain by using some client-side JavaScript. Our first order of business will be to check out the WHMCS hooks index to see if there is a hook point that will fit our needs: https://developers.whmcs.com/hooks/hook-index/ It turns out, the ClientAreaFooterOutput hook will do nicely: https://developers.whmcs.com/hooks-reference/output/#clientareafooteroutput The reason for this is because that hook point will allow you to inject HTML code, which also can contain JavaScript, into the client-side template so you can make the magic happen. Before getting into more detail, let's go ahead and dive right into the code. You can also download it from this link block_subdomains.txt (then rename the extension to .php). Here is the entire snippet: <?php add_hook('ClientAreaFooterOutput', 1, function($vars) { $jqueryCode = '<script> $("#owndomainsld").on("keyup", function(e) { var str = $("#owndomainsld").val(); if ( str.indexOf(".") != -1 ) { $("#owndomainsld").val(""); alert("Subdomains are not allowed!"); } }); </script>'; if (strpos($_SERVER['REQUEST_URI'], 'cart.php') !== false ) { return $jqueryCode; } }); The first thing to notice is the add_hook function is being called with the ClientAreaFooterOutput hook point as the first argument and an anonymous function as the second argument. The anonymous function also has a $vars variable being passed into it. For this example the $vars variable is not actually being used in the body of the function, but it does contain some useful parameters should you need to access them. Those parameters can be found in the documentation for the hook point linked above. The next thing to notice is the $jqueryCode variable. which is actually a PHP string that contains the JavaScript code we will be injecting into our client-side page. Since WHMCS uses the jQuery JavaScript library and loads it on the page, we can use it in our code. First, we need to bind an event listener to the keyup event on the domain text box and provide it a callback function to execute when that event occurs. This can be easily done by targeting the element's HTML ID attribute. That is what is happening here: $("#owndomainsld").on("keyup", function(e) {... After that, the value of the domain text field is stored in a JavaScript variable called str. Since this code is inside our callback function, it will be executed every time the user presses a key on the keyboard and then releases it: var str = $("#owndomainsld").val(); Once we have that text stored in our str variable, we need to check it for a dot or period '.' character to see if it is a subdomain. This can be done with indexOf string function in JavaScript. If the text appears to be a subdomain, we'll go ahead and empty out the text field and then show an alert to the user to let them know that subdomains are not allowed: if ( str.indexOf(".") != -1 ) { $("#owndomainsld").val(""); alert("Subdomains are not allowed!"); } Finally, the last part of the hook does a case-insensitive string search on the $_SERVER['REQUEST_URI'] (the URL of the page you're visiting), to check and see if a cart page is being rendered. If a cart page is detected, the JavaScript code is injected into that page so it can run. if (strpos($_SERVER['REQUEST_URI'], 'cart.php') !== false ) { return $jqueryCode; } Putting it all together, we get the final results in WHMCS which look like the picture here: I hope this post proved helpful and gives some insight on some of the ways that WHMCS can be extended to do many different things outside the box! At the time of writing this post, this hook was tested on the latest stable release of WHMCS 7.4.2 and should work with any that fall under Active Support as per the LTS schedule here: https://docs.whmcs.com/Long_Term_Support#WHMCS_Version_.26_LTS_Schedule If you have any feedback, questions, or concerns that I did not cover in this post, please feel free to reach out!
  23. Hi All, Has anyone had any experience with a hook updating an invoice? I want to use InvoicePaidPreEmail to append a credit card fee to the invoice. I understand WHMCS is not willing to budge on per Gateway charges, but I can disclose to my customers that there is a credit card fee of x% and then send the right payment value to the bank, once it returns as approved I can then append it to the invoice and prior to the email being sent it will now include the charge on the invoice. Any help with this is appreciated.
  24. I've created a provisioning module for v7.3.0 and I'm using the following to remove the Change Password button from the Module Command area in admin but it isn't working: add_hook('ClientAreaPrimarySidebar', 1, function(MenuItem $primarySidebar) { if(null !== $primarySidebar->getChild('Service Details Actions')) { $primarySidebar->getChild('Service Details Actions') ->removeChild('Change Password'); } }); Why isn't this working? It looks right to me.
  25. Hello, I have put the hook with the code below in the directory /includes/hooks/: ------------------------------------------------------------------ <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimaryNavbar', 1, function (MenuItem $primaryNavbar) { $urlidr = $vars['clientsdetails']['customfields15']; if (!is_null($primaryNavbar->getChild('Services'))&&!is_null($urlidr)) { $primaryNavbar->getChild('Services') ->addChild('Emergency Contacts', array( 'label' => Lang::trans('buyResellerWebsite'), 'uri' => $systemurl.'cart.php?a=add&pid='.$urlidr, 'order' => '100', )); } }); ------------------------------------------------------------------ The issue is that the variable $urlidr = $vars['clientsdetails']['customfields15'] remains empty, even though listed among those in the page with {debug} in the file clientareahome.tpl. Anyone can help me, please? Thanks.
×
×
  • 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