Jump to content

Kian

GearHead
  • Posts

    2155
  • Joined

  • Last visited

  • Days Won

    128

Kian last won the day on January 20

Kian had the most liked content!

About Kian

Recent Profile Visitors

16288 profile views

Kian's Achievements

Senior Member

Senior Member (3/3)

  • Great Support Rare

Recent Badges

426

Reputation

1

Community Answers

  1. Sadly you will end up delivering the same experience (terrible support and module that breaks on every update). Don't get me wrong. It's not your fault. That's what you are subjected to when coding modules for WHMCS. This is common to bascially every developer in this business. The only safe things to code are templates and simple stuff. For complex projects you are doomed with the usual bugs of WHMCS that never get fixed (they keep piling up), undocumented changes, deprecation of core features from day to night for silly reasons and revolutions that solve some problems creating new ones. Every new release of WHMCS will be a nightmare. There's a reason why there are less than 5 companies creating modules for WHMCS and also why 95% of modules listed in Marketplace are dead. You need more than one developer to maintain a module if you plan to sell it. There's no profit unless you price it for 300-400 euro / year but who is gonna buy it? Not so many people. Good luck.
  2. On paper there's AutoInstall SSL. A client of mine used it for year on Plesk but eventually decided to stop using it. Once out of two he still had to manually do stuff because of this or that issue. After so many years maybe they improved the integration. Who knows...
  3. The answer is Upgrade/Downgrade feature but keep in mind it is bugged and not unusable even though to my surprise many people are using it without even realizing there's a problem. In essence it uses two different formulas to calculate the same thing: Upgrade formula (used to let end-user preview costs): Total Due = (Total Debited - Total Credited) + Tax Rate Invoice formula (the one used to create the invoice): Total Due = (Total Debited + Tax Rate) - Total Credited All it takes to cause this bug is that a customer requests an upgrade and downgrade in the same time which is pretty usual (eg. I no longer want 2x 5GB email accounts but 1x 5GB and 1x10GB). Real life example. A client goes to upgrade/downgrade page. WHMCS informs him that the cost for upgrade/downgrade is 68.93 euro (this is a real example - if you want details just ask me). The customer is fine with upgrading costs and proceed with the order. WHMCS issues an invoices where asks him to pay 92.40 euro. With such a low amount of money there's a difference of 23.47 euro. Imagine what happens with bigger numbers. The resulting invoice is pure madness and your accountant will not be able to record it. Good luck 😁 p.s. This bug exists at least since 2011. I reported it in 2017. They told me they were going to fix it. 12 years later I am still waiting.
  4. IP address is attached to every message of the ticket therefore you have to remove it from every element of the array.
  5. I think auto-tags are case-sensitive. Try using {MONTH}, {DAY} and {YEAR} instead.
  6. I believe this solution no longer works for modern WHMCS since ipaddress is no longer part of {$reply.message}. To remove IP address you have to set it equal to false via ClientAreaPage hook point by overriding the value from bot $vars['ascreplies'] and $vars['descreplies'] as follows: add_hook('ClientAreaPage', 1, function($vars) { if ($vars['templatefile'] == 'viewticket') { $output = []; foreach ($vars['ascreplies'] as $index => $replies) { foreach ($replies as $k => $v) { if ($k == 'ipaddress') { $v = false; } $output['ascreplies'][$index][$k] = $v; } } foreach ($vars['descreplies'] as $index => $replies) { foreach ($replies as $k => $v) { if ($k == 'ipaddress') { $v = false; } $output['descreplies'][$index][$k] = $v; } } return $output; } }); In case I need to update something I uploaded the script on Github since this community doesn't let me edit posts after a certain amount of time.
  7. Simply enable this feature. This way WHMCS takes the effective Expiration Date from Registrar and uses it for Next Due Dates and then renewals.
  8. Yes, via action hook. Use EmailPreSend to detect when WHMCS is attempting to send the "Invoice Created" (messagename) email. If that's the case relid equals to invoice Id. Use it for retreiving the Id of the customer as follows. SELECT userid FROM tblinvoices WHERE id = {YOUR_RELID_AKA_INVOICE_ID} LIMIT 1 Now that you know userid simply count how many invoices the user in question has (I'm not counting Draft invoices): SELECT count(id) AS invoice_count FROM tblinvoices WHERE userid = {USER_ID} AND status NOT IN ("Draft") If invoice_count is = 1 return abortsend to prevent WHMCS from sending the email. Even better you could simply try to select the first two invoices as follows: SELECT id FROM tblinvoices WHERE userid = {USER_ID} AND status NOT IN ("Draft") LIMIT 2 The count() in PHP if returned rows are 1 (abortsend) or 2 (don't do anything) This is approach is more efficient since you stop the SELECT as soon as it finds 2 invoices instead of counting them all. ----- In case you want to suppress email sending for every new hosting/service purchase the logic is the same. In EmailPreSend hook point run a query to retreive the product Id: SELECT tblinvoiceitems.relid AS product_id FROM tblinvoices LEFT JOIN tblinvoiceitems ON tblinvoices.id = tblinvoiceitems.invoiceid WHERE tblinvoices.id = {YOUR_RELID_AKA_INVOICE_ID} AND tblinvoices.status NOT IN ("Draft") AND tblinvoiceitems.type = "Hosting" LIMIT 1 Now count in how many times the product Id in question appears on invoices: SELECT COUNT(tblinvoiceitems.id) AS invoice_count FROM tblinvoices LEFT JOIN tblinvoiceitems ON tblinvoices.id = tblinvoiceitems.invoiceid WHERE tblinvoices.relid = {YOUR_PRODUCT_ID} AND tblinvoices.status NOT IN ("Draft") AND tblinvoiceitems.type = "Hosting" Or even better the LIMIT 2 approach: SELECT tblinvoiceitems.id FROM tblinvoices LEFT JOIN tblinvoiceitems ON tblinvoices.id = tblinvoiceitems.invoiceid WHERE tblinvoices.relid = {YOUR_PRODUCT_ID} AND tblinvoices.status NOT IN ("Draft") AND tblinvoiceitems.type = "Hosting" LIMIT 2
  9. The first title comes from your $_LANG while the second, judging from its particular location, should come from {$headoutput}. In this variable WHMCS puts all content returned in ClientAreaHeadOutput. In other word on your system there is probably an action hook responsibile for title duplication. You should look inside includes/hooks and also make sure no module is returning title tag via action hook. p.s. My 2 cent. Don't waste time with SEO in WHMCS. It is not worth the effort. Real-life improvements are laughable and non-existent. All you get in return is probably a SEO tool that scores you higher and higher but this doesn't automatically translate into better indexing. You need way more than just a titles and meta tags to get something relevant not to mention WHMCS multi-language is session-based hence search engines will never index you site in other languages. Lastly what's the point of crafting titles and metas when WHMCS is a generator of duplicate contents?
  10. Don't waste time testing cron-based hook points using the actual cron. Save time as follows: While I'm still coding, I comment AfterCronJob trigger and temporarily replace it with AdminAreaPage. At the very top of the function I put a condition that immediatlly exits the script if the query string is missing simulate_cron parameter. In other words I can browse WHMCS backend as normal. Whenever I want to simulate the cron I simply need to add ?simulate_cron=blabla in the query string on any page I am (eg. yourwhmcs.example.com/clients.php?simulate_cron=1). This way you can test your script without waiting for real cron job. Moreover if there's an error you can see that on screen. When you're ready to go live simply remove AdminAreaPage trigger and remove comment for AfterCronJob. Alternatively you can use an approach like this one basically a button you can press to run the cron job on click.
  11. Alternatively edit your configuration.php file and add the following: date_default_timezone_set('Europe/Rome'); Don't forget to change timezone accordingly.
  12. Look for uid in PHP session array. It sores the ID of the currently logged customer.
  13. In case it's bugged open tblconfiguration table and look for your module system name in value column for the following settings: AddonModulesHooks (comma separated list like this: module_one,module_two,another_module) ActiveAddonModules (still comma separated list) AddonModulesPerms (json array)
  14. There's no clean way to prevent email sending. If Domain Synch was an Email Template, we could have stop it via EmailPreSend. Sadly WHMCS sends it by directly requiring (or initializing) phpMailer file (or class). The only solution is an hack. Edit phpMailer loader file so that it throws a die(); when it is included or initialized by crons/domainsync.php. It works but it is ugly and your change will be reverted back on every update of WHMCS. A more sensical approach is to use a filter on your email so that the all incoming emails with "WHMCS Domain Synchronisation Cron Report" title automatically go in "Automatic email" folder. If like me you recieve a lot of such useless emails (I have access to hundreds of WHMCS systems that flood me with thousands cron/sync emails on a daily basis) also enable automatic cancellation after X days.
  15. I didn't build PEPPOL integration but the integration with electronic invoicing. I know both share similarities but they're two separate things. I gave electronic invoicing enough time already. I no longer focus on complex projects like this one that very few people will use. Not even for a million dollar 😁 Btw electronic invoicing & BX is active and maintained. It's just that I no longer provide free support because it is not worth it. Complex stuff + many customers + one guy = 🤯 I know it sucks but I wanna have a life.
×
×
  • 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