plusplushosting Posted September 9, 2020 Share Posted September 9, 2020 Hi there, I have modified this Brian's hook i had....(phone for Brian 🙂 ) but is not passing the array for any reason, i guess im missing something. I wish to pass the registrar information to the clientareaproductdetails tpl Any help will be great. Thanx in advance!  <?php # Written by brian! use WHMCS\Database\Capsule; function cdomain_renewals_registrar_name_inproddetails_hook($vars) { if ($vars['templatefile'] == 'clientareaproductdetails') { $client = Menu::context('client'); $domains = $vars['domains']; foreach($domains as $key => $domain) { $registrar = Capsule::table('tbldomains')->where('userid',$client->id)->where('domain',$domain['domain'])->value('registrar'); if ($registrar) { $domains[$key]['registrar'] = $registrar; } } } return array ("domains2" => $domains); } add_hook("ClientAreaPage", 1, "cdomain_renewals_registrar_name_inproddetails_hook");  0 Quote Link to comment Share on other sites More sharing options...
brian! Posted September 10, 2020 Share Posted September 10, 2020 13 hours ago, plusplushosting said: i guess im missing something the productdetails page wouldn't have a $domains array - only the value of a single domain (if one is associated with that service). to get the registrar value on that page, you could do... <?php # Product Details Domain Registrar Hook # Written by brian! use WHMCS\Database\Capsule; function cdomain_renewals_registrar_name_inproddetails_hook($vars) { $client = Menu::context('client'); $domainID = intval($vars['domainId']); if (!empty($domainID)) { $registrar = Capsule::table('tbldomains')->where('userid',$client->id)->where('id',$domainID)->value('registrar'); return array("registrar" => $registrar); } } add_hook("ClientAreaPageProductDetails", 1, "cdomain_renewals_registrar_name_inproddetails_hook"); and that will give you a $registrar value that you can either use further in the hook, and/or return it to the template so it can be accessed by it. and to answer your next question - yes it would be possible to output this value on the page - either using this hook, using a jQuery hook or directly in the template... which is best depends on where you want to add the output. 0 Quote Link to comment Share on other sites More sharing options...
plusplushosting Posted September 10, 2020 Author Share Posted September 10, 2020 Thanx Brian! But is half working 🙂 As im using the /modules/servers/cpanel/templates/overview.tpl to modify the product details page, is not passing the variable there, even it is in the productdetails template i guess the include of overvirew.tpl is the problem. Thanx! 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted September 11, 2020 Share Posted September 11, 2020 17 hours ago, plusplushosting said: But is half working oh you wanted it 100% working? 😲 17 hours ago, plusplushosting said: As im using the /modules/servers/cpanel/templates/overview.tpl to modify the product details page, is not passing the variable there, even it is in the productdetails template i guess the include of overvirew.tpl is the problem. then change the hook from ClientAreaPageProductDetails to ClientAreaProductDetailsPreModuleTemplate and that should work. 0 Quote Link to comment Share on other sites More sharing options...
plusplushosting Posted September 11, 2020 Author Share Posted September 11, 2020 2 hours ago, brian! said: oh you wanted it 100% working? 😲 well....is like buying me a Maserati and don't give me the key 🙂 Thanx very much man! Have a great weekend! 0 Quote Link to comment Share on other sites More sharing options...
Ahmad Hameed Posted October 31, 2025 Share Posted October 31, 2025 How to return Password of the service ? by default, the username {username} returned but how to get password of the service on /modules/servers/cpanel/templates/overview.tpl ?? 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.