Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation since 12/17/2019 in Posts

  1. 4 points
    $38.14 + 18% = $45 if the tax is inclusive, then the price already contains the tax... so if the price were $118, the tax would be $18 and the subtotal $100 https://docs.whmcs.com/Tax/VAT#Inclusive.2FExclusive_Tax Tax Amount = ( Item Price / ( 100 + Tax Rate ) ) x Tax Rate Tax Amount = ( 45 / ( 100 + 18 ) ) x 18 = 6.86
  2. 3 points
    if there is no functionality or automation needed, then i'd still stick with using the Email Registrar idea - but remember that this registrar module code isn't encrypted and therefore can be duplicated and modified. 😉 to duplicate the registrar, all you should need to do is... copy the "email" folder in /modules/registrars - for the sake of argument, paste the duplicated folder and call it "brian" - still in /modules/registrars/ go into the duplicate folder, e.g brian, and rename email.php to brian.php - for consistency keep the folder and filenames the same (and just one word). edit the brian.php file and replace occurrences of "email_" with "brian_" (there should be 6)... these functions need to be unique, so if email registrar is active, and this duplicate is active, you will get errors - so you have to rename the functions. edit the Friendly name line of code to differentiate this from the default email registrar... "FriendlyName" => array("Type" => "System", "Value"=>"Email Notifications (Brian Registrar 1)"), ... so you know which registrar this is to be used with... optionally change the logo. repeat as necessary for other registrars. on the Domain Registrars page, you will now have 2 different email registrars... and in a client's domain profile, it will be available as an option... in your case, what I would probably suggest is that you don't use the original Email Registrar module if you are going to rename it (e.g give it the name of a registrar) because a WHMCS update would probably overwrite any changes that you make to the module - so just use the duplicates that you make and the updater shouldn't touch them.
  3. 2 points
    too many years of knowing which variables/array are available on an admin area page... 😉 out of the box, the stats array wouldn't contain those values about todo items... you would need a simple hook to query the table to get the value - i've PM'd you a basic hook to do that, and it will give you a {$todostats} variable which you can use in the admin area template to show how many to do items there are that are not completed... as written, it gets the total for everyone, to get a total for the current logged in admin, you can just uncomment the line in the hook that i've commented out. and then with regards to the language files, it's just a case of working your way through english.php (or your own language) to see if an appropriate string already exists for your need - if not, either use a Language Overrides or just hardcode it in the template.
  4. 2 points
    I ran into an issue with this hook today - it works fine on a product linked to cPanel, but with other products it shows a blank page. with the assistance of sentq, I was able to tweak it to work correctly. <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimarySidebar', 1, function(MenuItem $primarySidebar) { $service = Menu::context('service'); $domain = $service->domain; $servertype = $service->product->servertype; # Not cPanel, no links added if ($servertype!="cpanel"){ return; } if (!is_null($primarySidebar->getChild('Service Details Actions'))) { $primarySidebar->getChild('Service Details Actions') ->getChild('Login to cPanel') ->setUri('http://'.$domain.'/cpanel'); $primarySidebar->getChild('Service Details Actions') ->getChild('Login to Webmail') ->setUri('http://'.$domain.'/webmail'); } });
  5. 1 point
    @brian! It's people like you that I love 🙂 I will give that a try. Thanks for the continued help! Happy New Year! Cheers!
  6. 1 point
    Setting them to free would work. Personally for my own personal hosting accounts/domains I have never added them to WHMCS. I have not seen a benefit to doing that aside from the one click login from within the client profile.
  7. 1 point
    sadly, that placeholder value is hardcoded and doesn't use a language string... you could argue that it not using a language string is a long-standing bug - I can't see why it couldn't use a language string for a placeholder. 🙄 one way to fix it would be a footer hook that replaces the placeholder text...
  8. 1 point
    the code in your attached file works fine - except that you forgot to include a closing {/if} at line 193... without that closing IF statement, it will cause an error and display a blank area; but with it, you should see it working.
  9. 1 point
    if you're creating a custom report, then you would create a new file (in /modules/reports), possibly using an existing report file as a template. with regards to the additional field values themselves, then they're stored in the database, specifically the tbldomainsadditionalfields table, but you'd probably have to join it to tbldomains to get any results that made sense.
  10. 1 point
    what happens if you change to Namespinner ?
  11. 1 point
    That is really bad practice for you to act as their domain registrar yet the entire domain is in your name. I see other businesses do this too and I cringe. It's the customers domain and not someone elses so just update the technical contact and leave the other Whois information alone.
  12. 1 point
    there are no specific hooks for those tiles - editing the template is the way to go.
  13. 1 point
    For those concerned, this is how we fixed the error. Older WHMCS custom merchant gateway module documentation suggested that module should implement one of functions: modulename_3dsecure() or modulename_capture(), depending on which one the payment gateway supports. Now, since version 7.8.2, it appears that WHMCS has been calling modulename_capture() in first place regardless of it's existance in the module code. So adding the following code to our custom module fixed the issue: function modulename_capture($params) { modulename_3dsecure($params); }
  14. 1 point
  15. 1 point
    are you talking about the related services dropdown? if so, I posted a hook a year ago in the thread below than can be used to hide specific statuses (and optionally sort their order so that the active services are shown first)... in your case, you would just change the line below in the hook to include all of the statuses that you want to hide... $cancelled = array('Cancelled','Terminated','Expired','Grace Period (Expired)');
  16. 1 point
  17. 1 point
    I would have thought the simplest option would have been from the admin area invoices page - click on the unpaid invoices menu link, click the check-all checkbox (top left) and then the "Mark Cancelled" button. doing that would allow you to cancel upto 200 invoices in one go... if there are more than 200 to cancel, then you would need to repeat it 200 at a time.
  18. 1 point
    I've expanded this hook a bit to also cover failed transfers and log everything it does to the activity log. <?php use WHMCS\Database\Capsule; add_hook('DomainTransferCompleted', 1, function($vars) { //This hook will complete to-do items for transfers when the transfer is completed. $toDoID = Capsule::table('tbltodolist') ->where('status', 'In Progress') ->where('title', 'Domain Pending Transfer') ->where('description', 'LIKE', '% ' . $vars['domain'] . '%') ->get(); //Loop through the ID's and set them as completed. foreach ($toDoID as $entry) { $command = 'UpdateToDoItem'; $postData = array( 'itemid' => $entry->id, 'adminid' => '1', //Update this ID to an admin ID 'status' => 'Completed', ); localAPI($command, $postData); logActivity('Clean-up To-do List: ID ' . $entry->id . ' has been set as complete as the transfer completed successfully - Domain ID: ' . $vars['domainid'] . ' - Domain: ' . $vars['domain']); } }); add_hook('DomainTransferFailed', 1, function($vars) { //This hook will update to-do items for ttransfer that fails. $toDoID = Capsule::table('tbltodolist') ->where('status', 'In Progress') ->where('title', 'Domain Pending Transfer') ->where('description', 'LIKE', '% ' . $vars['domain'] . '%') ->get(); foreach ($toDoID as $entry) { $description = Capsule::table('tbltodolist') ->where('id', $entry->id) ->value('description'); $command = 'UpdateToDoItem'; $postData = array( 'itemid' => $entry->id, 'adminid' => '1', //Update this ID to an admin ID 'status' => 'Incomplete', 'description' => '*FAILED* '.$description, ); localAPI($command, $postData); logActivity('Clean-up To-do List: ID ' . $entry->id . ' has been set as incomplete as the transfer has failed - Domain ID: ' . $vars['domainid'] . ' - Domain: ' . $vars['domain']); } });
  19. 1 point
    thanks! 🙂 in that first link I gave you, there was another hook that creates a login form, and if your WHMCS contains the username/password to their service, then that can be used to login directly to their cPanel... ... though i'd suggest changing http to https and adding 1 to the ports uses for cPanel/Webmail (2083 & 2096)... that second link I gave you does contain an updated version of the above hook that doesn't need username/password for the cPanel link, but it uses the default URL of clientarea.php?action=productdetails&id=xxx&dosinglesignon=1 for the cPanel link - which is no good for you as that's the URL you're having problems with. if you can't get that second hook to suit your needs, then as @penguin suggests, you might be better off changing your WHM (not WHMCS) redirection settings - you may need to contact your host for help with that.
  20. 1 point
    Lagom WHMCS Email Template - FREE We’ve just released a Lagom WHMCS Email Template, it’s available in our store completly for Free!! With active license of Lagom WHMCS Theme you will gain access to the simple email template management from the WHMCS addon. You won’t need to have any HTML and CSS knowledge, to customize the Lagom WHMCS Email Template to your needs. You can choose from 3 styles: Futuristic Style - live demo Depth Style - live demo Minimal Style - live demo Lagom Extension Configure Header Text Configure Social Links Configure Footer Links Choose Style Live Preview
  21. 1 point
    So I chose the hooks way to get the same implemented into the admin interface. Below is the hook to be used to make it display the required custom field's value along with the product name: <?php if ( !defined('WHMCS')) { header("Location: ../../index.php"); } use WHMCS\Database\Capsule; // Please set custom field id here. $customfieldId = 1; if($_REQUEST['getAll'] == '1') { if($_REQUEST['userid'] != '') { $all = Capsule::table('tblcustomfieldsvalues') ->join('tblhosting', 'tblcustomfieldsvalues.relid', '=', 'tblhosting.id') ->where('fieldid', $customfieldId ) ->where('userid', $_REQUEST['userid'] ) ->get(); }else { $all = Capsule::table('tblcustomfieldsvalues')->where('fieldid', $customfieldId)->get(); } $all = json_decode( json_encode( $all ) , true ); $newAll = []; foreach($all as $a) { $newAll[$a['relid']] = $a['value']; } ob_clean(); echo json_encode(array( "all" => $newAll )); die; } add_hook('AdminAreaPage', 1, function($vars) { if( $vars['filename'] == 'clientsservices' ) { echo '<script> document.addEventListener("DOMContentLoaded", function(){ $.post(window.location, { getAll: 1 }, function(data, status){ var data = JSON.parse(data); var first = []; setInterval(function() { var x = document.querySelectorAll("[data-value]"); for (var i = 1; i < x.length ; i++) { if(typeof first[x[i].dataset.value] === "undefined") { first[x[i].dataset.value] = x[i].innerText; } if(typeof data.all[x[i].dataset.value] !== "undefined" && data.all[x[i].dataset.value] != "") { x[i].innerText = first[x[i].dataset.value] + " - " + data.all[x[i].dataset.value]; } } }, 100); }); }); </script>'; } if( $vars['filename'] == 'clientshostinglist') { echo '<script> document.addEventListener("DOMContentLoaded", function(){ $.post(window.location, { getAll: 1 }, function(data, status){ var data = JSON.parse(data); var table = document.getElementById("sortabletbl1"); var rows = table.rows; for (var i = 1; i < rows.length ; i++) { if(data.all[rows[i].cells[1].innerText] != null && data.all[rows[i].cells[1].innerText] != "") { rows[i].cells[2].innerHTML = rows[i].cells[2].innerHTML+ " - " + data.all[rows[i].cells[1].innerText]; } } }); }); </script>'; } }); The only thing that needs to be setup is the $customfieldId inside the hook. Hope this is useful to someone. Thanks!
  22. 1 point
    it would be better to use a ClientLogout hook to avoid repeatedly having to edit the template after an update - which is what I gave @sokalsondha on the day he posted.
  23. 1 point
    Hello everyone. I just got my WHMCS license and I went to configure it. Now, I've got an issue. This is it, it's on the home page. How do I get rid of it?
  24. 1 point
    the code in post #3 will do that. https://forum.whmcs.com/showthread.php?124790-Adding-a-quot-Credit-Balance-quot-panel-to-the-client-area-home-page&p=500630#post500630
  25. 1 point
    you can add the timezone to your whmcs configuration file, just edit the line below for your chosen time zone. date_default_timezone_set('Europe/London');
×

Important Information

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