Jump to content


Popular Content

Showing content with the highest reputation since 07/28/20 in all areas

  1. 2 points
    Okay, I evolved the hook to support 3 different types of alerts. And I coded everything from scratch to add two new features regarding "one-off" products: First-timer tollerance. New customers are allowed to order everything they want. Once they register the fun is over An option to restrict purchases even further. Here's an example. Let's say that Bronze and Silver two "one-off" products off - Customer can purchase Bronze and Silver then they can no longer purchase them on - As soon as customer orders Bronze, he can't order Silver (and another Bronze of course) I'm still perfecting and changing the code so you can find it on github. I'm looking for bugs at the moment 🙏
  2. 1 point
    I still have to ask, why haven't the templates and themes been updated to support Bootstrap 4? With Bootstrap 5 being released, theme developers are forced to use antiquated frameworks that should have been deprecated a year ago. With a major upgrade like WHMCS 8, this is a huge disappointment.
  3. 1 point
    Setup > Payments > Tax Configuration > Advanced Settings > Calculation Mode. Make sure Calculate based on collective sum of the taxable line items is selected.
  4. 1 point
    Got it. There was an unnecessary filter by date <= current date on "Terminated" products/domains. I updated the script. It should work now. Edit: I realized now that I was also counting "Free" products/services. I'm going to change the script so that they're not part of the report.
  5. 1 point
    I noticed more than one problem. The core of the issue is that I'm starting the year with a wrong calculation. I'll fix it as soon as I can.
  6. 1 point
    the one that i'm familiar of referencing is on GitHub... https://github.com/ajarmoszuk/WHMCS-Gateway-Fees I think that would still work on the latest version of WHMCS, but only if still using PHP 5.6... once you move into PHP7, it will fail as it's core code is outdated - though probably easily fixable. the other free one in Marketplace would be Gateway Fees for WHMCS - but sadly, that is poorly written as I found when I was PM'd about tweaking it by a client... the module is encoded, so tweaking options were limited - but one of the annoying things that it does is to add a gateway fee even when you're just viewing (in the admin area) an old PAID invoice from years ago... I ended up needing to directly edit the database to remove the nonsense it was adding to already paid invoices. 😠 so I wouldn't recommend using that - even on a dev, i've deleted all its files to avoid such situations occurring again. aahh, the ModulesGarden addon module - yeah $70 per year (btw - not a one off fee but recurring!) is a little expensive to say the least, but you'll find other options in Marketplace in the $20-30 range... some will be one-off charges, others will be recurring. however, if you say you won't need it for a few months, then i'd suggest leaving it until v8 is released (if you're going or can upgrade) and see how many of these addons have been updated for it, or if any other free alternatives become available in the meantime.
  7. 1 point
    There is no Inactive state for domains on WHMCS. Do you maybe mean Pending or Cancelled? All domains in the same registry will be synchronized, that is how WHMCS works right now. And yes, it will sync all active domains, pending transfer, expired, etc. If a domain was expired and then it was renewed, it should sync that and change back the status.
  8. 1 point
    just on a purely visual level in the client area, emails and invoices etc, if you just want to change the text, then it's a Language Overrides for each language applicable to your site... $_LANG['ordersetupfee'] = "Payment Gateway Fee"; just bear in mind that there is no additional functionality being applied here, so.... I assume there is only one gateway ? if there are more, and the fee needs to vary based on the gateway, then that would need additional coding... and at that point, you might as well go to Marketplace and check out the Gateway Fees addons available in there. these fees would only be charged during the initial order - they wouldn't automatically be applied to any subsequent renewal invoices. this change wouldn't impact on the content of previous invoices - for products with setup fees, they will still say SF and not PGF. I can think of other similar issues, but they would only arise if you were trying to make the idea have the required functionality - but if all you want to do is just change the label of setup fees, then they're probably irrelevant.
  9. 1 point
    the non-programming way to do this might be to use a custom additional domain field... https://docs.whmcs.com/Additional_Domain_Fields $additionaldomainfields[".com.au"][] = array("Name" => "Further Information","Type" => "display","Default" =>"<div class=\"alert alert-success\" role=\"alert\">Click <a href=\"https://google.com\" target=\"_blank\">here</a> for important details about .au registrations.</div>"); although because of the way WHMCS have coded the feature, I think it more likely the field would be added to the end of the existing fields rather than the start... though there are some nasty ways around that if it's an issue. if you're going down the programming route, then it's either an edit to the configuredomains.tpl template (if statement), or an action hook - but whether a hook would be practical depends on how and where the alert would be shown.
  10. 1 point
    There's no need to join the same table. Just count by CASE. Try with this one. SELECT (CONCAT(YEAR(regdate), "-", MONTH(regdate))) AS period, COUNT(CASE WHEN domainstatus = "Terminated" THEN 1 ELSE NULL END) AS terminatedAccounts, COUNT(CASE WHEN domainstatus = 'Active' THEN 1 ELSE NULL END) AS activeAccounts, (COUNT(CASE WHEN domainstatus = "Terminated" THEN 1 ELSE NULL END) / COUNT(CASE WHEN domainstatus = 'Active' THEN 1 ELSE NULL END) * 100) AS churnRate FROM tblhosting GROUP BY YEAR(regdate), MONTH(regdate) DESC Here's a sample result.
  11. 1 point
    <?php use WHMCS\Database\Capsule; add_hook('FraudOrder', 1, function($vars) { $admins = Capsule::table('tbladmins')->where('disabled', '=', '0')->pluck('username'); foreach ($admins as $username) { localAPI('SendAdminEmail', array('type' => 'system', 'customsubject' => 'Fraud Order Detected', 'custommessage' => 'Order #' . $vars['orderid'] . ' detected as Fraudulent'), $username); } }); It should work. It sends the notification to all active administrators.
  12. 1 point
  13. 1 point
    Thanks for your feedback/suggestion. I've logged a case with our developers to review and consider this for future updates.
  14. 1 point
    The following hook allows customers to login to Plesk, cPanel, DirectAdmin and any other panel directly from My Services list. Here's a preview (last column). Below I'm going to post the action hook but keep in mind that you'll need to make some changes to a couple of template files. The hook works with any control panel. The only requirement is that servers and products have been configured correctly. <?php /** * Auto-Login to cPanel/Plesk from My Services * * @written_by Kian */ use WHMCS\Database\Capsule; add_hook('ClientAreaPage', 1, function($vars) { if ($vars['filename'] == 'clientarea' AND $_GET['action'] == 'services') { $productIDs = Capsule::select(Capsule::raw('SELECT t1.id, t2.type FROM tblhosting AS t1 LEFT JOIN tblservers AS t2 ON t1.server = t2.id WHERE t1.userid = ' . $_SESSION['uid'] . ' AND t1.server != "0" AND t1.domainstatus IN ("Active", "Suspended") AND t1.username IS NOT NULL AND t1.password IS NOT NULL AND t2.type IS NOT NULL')); foreach ($productIDs as $v) { $output['kt_autologin'][$v->id] = $v; } return $output; } }); add_hook('ClientAreaHeadOutput', 1, function($vars) { if ($vars['filename'] == 'clientarea' AND $_GET['action'] == 'productdetails' AND $_GET['id'] AND $_GET['autologin']) { return <<<HTML <script type="text/javascript"> $(document).ready(function() { $("#domain form").removeAttr('target'); $("#domain form").submit(); }); </script> HTML; } }); Open your templates/{YOUR_TEMPLATE}/clientareaproducts.tpl where we need to add the new column. Let's begin from thead section. Add a new column like follows. Replace "Manage" defining a $LANG variable for multi-language support. Next move to tbody right inside foreach loop. Create a new cell like follows. <td class="text-center"> {if $kt_autologin[$service.id]} <div class="btn-group btn-group-sm plesk-login" style="width:60px;"> <a href="clientarea.php?action=productdetails&id={$service.id}&autologin=1" class="btn btn-primary btn-xs" alt="Click to Login" title="Click to Login" style="padding: 2px 5px;"><img src="templates/{$template}/img/katamaze_autologin/{$kt_autologin[$service.id]->type}.png" style="height:22px; max-width:39px"> <i class="fa fa-sign-in fa-fw" aria-hidden="true"></i></a> </div> {/if} </td> Replace "Click to Login" (alt and title attributes) with a $LANG variable. To display Plesk, cPanel, DirectAdmin (...) logo inside the button, create this directory templates/{YOUR_TEMPLATE}/img/katamaze_autologin. Here you have to add all logos in PNG format. The name of the file should be equal to module's system name: plesk.png cpanel.png directadmin.png etc. Now we have to disable sorting for the newly added column. At the very top of your template there's the following statement. Change (or add) noSortColumns="4" accordingly. "4" means that the 5th column will be not sortable (column count starts from zero). {include file="$template/includes/tablelist.tpl" tableName="ServicesList" noSortColumns="4" filterColumn="3"} Last but not least, open templates/{YOUR_TEMPLATE}/includes/head.tpl. Place this code at the very bottom of the file. {if $smarty.get.autologin} <style> body { visibility:hidden; } </style> {/if} A little bit of background For years I get used to show these buttons with a different approach. Basically I was retrieving and decrypting usernames and passwords from tblhosting and performing login with a separate form. For more than one reason (security & maintainability) I switched to this other approach.
  15. 1 point
    when you're checking the source code, you need to see what the menuitemname value is - whatever that is, that's what you need to use in removeChild.
  16. 1 point
    Nearly a year later, it seems this bug still hasn't been corrected. I'm glad to know it isn't just me, and I appreciate this thread! Thanks much, @weelow.
  • 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