Jump to content

DennisHermannsen

Member
  • Content Count

    679
  • Joined

  • Last visited

  • Days Won

    19

Everything posted by DennisHermannsen

  1. Well, you're right. Nobody asked for it. There has been a ton of threads just like this one where people are overwhelmingly negative towards this change.
  2. You can't manually reset it anymore. The only way to reset it is by sending a password reset email to the client.
  3. @Tiaan that would require a way to store the ID - most likely in the database. You would need to create a separate table. During the ClientAdd event, you need to generate the customer code and store it in the database.
  4. Well, it is possible, but you'd have to use your own code to achieve it. You could use the product price feed: https://docs.whmcs.com/Data_Feeds#Product_Pricing_and_Currency You'd then have to basically build your own product page to have the prices shown in USD. Also, when the visitor puts the product in their cart, it would show up as whatever default currency you have configured.
  5. You're quoting the documentation for the PayPal Checkout module, not the PayPal Basic module. Both modules are still supported by WHMCS. PayPal Basic allows to force one-time payments. PayPal Checkout doesn't.
  6. Seeing that the Paper Lantern theme is not supported anymore, that shouldn't be a problem. cPanel will only ship with the Juniper theme from now on.
  7. Nothing in WHMCS will automatically do that. It's most likely a hook or a rewrite rule.
  8. WHMCS will automatically calculate the difference in price from the old product and the new product. If the price difference is 10 USD and the client is exactly halfway into their billing period, they will be charged 5USD. If they have 100% left of their billing cycle, they're charged 10 USD.
  9. Just use a link like this: https://yourdomain.com/submitticket.php?step=2&deptid=1&subject=WhateverYourSubjectShouldBe
  10. One thing to note: It won't work with IDNs. I've reported that bug a few weeks ago. Could that be the issue in your case?
  11. If all of your third party modules/hooks are compatible with the latest version of WHMCS, you can upgrade without issues. You will need to be running PHP 7.2 or newer to use WHMCS 8 or newer.
  12. You'll find those items in the "header.tpl" file - it doesn't make much sense, but it's there. It's located around line 188.
  13. This has bothered me for a long time. I love it when WHMCS introduces new features, but trying to implement some of it is often a challenge. Why is there no built in support for multi-language support unless you're trying to build an "addon" module? Basically any other type of module can output code to the client area, and it makes no sense that you have to write your own code to support multi-language. I mean, the code already exists in WHMCS 😅 The documentation is lacking a lot of information. Take this as an example: https://developers.whmcs.com/provisioning-modules/supported-functions/. There are some functions (like _AdminArea) that just has no information at all. How is it used? You can't echo or return anything. Is it just a typo and meant to say _AdminLink? I know how to use that function by looking at other modules, but there's still no documentation about it. Why is there no documentation for Application Links? It's a really cool feature, but it makes no sense that the feature is basically reserved for cPanel. Another nice feature that feels like it was only built for cPanel is Server Sync - mostly because of this: https://docs.whmcs.com/Servers#Sync_Report ... But some control panels do. I know that cPanel doesn't. Some other control panels (not just limited to web hosting) do keep a record of the user's full name, address, phone number etc. Importing a client into WHMCS using the Server Sync feature feels so akward. Who wants to send an email to their customer that starts with "Dear Name Placeholder"? That's very unprofessional. I know that not all control panels track the client's details, but who thought it would be a good idea to not even implement importing the details in case the control panel actually did? It would make life so much easier for WHMCS admins wanting to import clients. I hope someone can give me an explanation that isn't "Because WHMCS just doesn't care" 😅
  14. I think I found a rather simple way of doing what I'm trying to achieve. https://pastebin.com/fYWhNxNr (I'm also having issues with their WAF, lol) I just need to call /modules/servers/myModule/script.php?serviceId=<serviceId>. The $server object has all the stuff I need to make API calls (access hash, hostname of the server etc.) Any thoughts on that way to do it?
  15. Thanks for the thorough explanation, @string! I actually managed to find method 1 myself. I'm not worried about SSL checks, though - the services that the module will manage does not have a domain set. I didn't consider that WHMCS would call hooks for the ClientArea function on each call. I'll see if I can get it working using your other example. One quick question: How would I access the module parameters if doing it that way? It's not just service params, it's stuff like the access hash that's defined in the provisioning module.
  16. I have no idea how to pull this off in WHMCS so I'm hoping for some help. I'm building a module that outputs some data to the client area (CPU usage and stuff like that). I really want this data to update every 5-10 seconds. I know how to query the data - I just don't know how I can do this in WHMCS. I thought about creating a custom function in the module that gets the relevant data and then returns it - but WHMCS seems to always want to render the client area 😅 What I basically need is a blank page where I can output json. I need the $params variable, so I can't do this outside of WHMCS. Any ideas?
  17. Since the variable name passed to the function is $vars, you won't be able to get any details with $params. This code will work: <?php add_hook('ClientAreaPageViewInvoice', 1, function($vars) { if($vars['client']['country'] === 'DE'){ // do stuff } });
  18. Maybe it would work if you check whether the the relid for the tblinvoiceitem row already exists for other rows? If it exists more than once, the product/domain has already been invoiced before.
  19. None of the "bugs" you mention are bugs. You're editing default templates - they are gonna get overwritten. WHMCS even tells you to copy the default theme and make changes to the copy.
  20. This issue is also a problem with 'Set Recurring Billing Information' during Server Sync for modules. If Client Date Format is set to "Monday, January 1st, 2000", you'll get the same error. Setting it to use the global format fixes the issue.
  21. @Kian small thing to note about InvoiceCreationPreEmail: I haven't used that hook event for a long time, and I'm pretty sure that ^ is the reason I stopped using it 😅 I don't know if it has been changed since I last used it.
  22. If you're seeing a "Connection timed out" error, it's most definitely a firewall issue. Either your server is blocking the connection to port 995 on pop.gmail.com, or gmail is blocking your incoming request. Are you able to telnet to port 995 on pop.gmail.com?
  23. A few. You just can't use them for WHMCS. WHMCS will only run on IonCube (unless they start encoding using a different library). As support for PHP 7.4 ends on 28 Nov 2022, I'm sure WHMCS is already looking for a way to work around IonCube. Despite a lot of flaws, I doubt they're going to force their clients to use outdated PHP versions.
  24. Would that not cause a small issue when WHMCS is sending the invoice to the client? The documentation states this: Your regex pattern(s) are way better than what I suggested. Quick question that might be a bit off topic: Is there any difference on using models vs capsule? I know that they're basically the same thing but I'm just wondering if there's any reason to use one instead of the other.
  25. @leew87 hooks are to be placed in /includes/hooks/ - unless they are part of a module. I don't think the code should run on InvoiceCreated, though - that hook runs after the invoice has been sent to the client, and as such the client would see the dates on the invoice. Executing on InvoiceCreation should work for this. Hook documentation can be found here: https://developers.whmcs.com/hooks-reference This should do the trick for you: <?php use WHMCS\Billing\Invoice; add_hook('InvoiceCreation', 1, function($vars) { // $vars allows us to use get the specific invoice id $invoiceID = $vars['invoiceid']; // Get data related to the invoice. See this for documentation on models: https://docs.whmcs.com/Using_Models // It would also be possible to use Capsule to query the database instead of using the Invoice model. See information on database queries here: https://developers.whmcs.com/advanced/db-interaction/ $invoiceItems = Invoice::find($invoiceID)->items; $pattern = '/\(([0-3][0-9]|[0-1][0-9]|[\d]{4})(\/|\.|-)([0-1][0-9]|[0-3][0-9]|)(\/|\.|-)([\d]{4}|[0-1][0-9]|[0-3][0-9]) - ([0-3][0-9]|[0-1][0-9]|[\d]{4})(\/|\.|-)([0-1][0-9]|[0-3][0-9]|)(\/|\.|-)([\d]{4}|[0-1][0-9]|[0-3][0-9])\)/'; foreach ($invoiceItems as $invoiceItem) { preg_match($pattern, $invoiceItem->description, $matches); $invoiceItem->description = str_replace($matches[0], '', $invoiceItem->description); // Update the description of the invoice's line item $invoiceItem->save(); // Save to the database } }); Quickly explained: We use the Invoice model to find the related invoice during invoice creation. At this time, line items already exists. We define a regex pattern to search for the dates in the line item description. The pattern should match the following types of dates but I would test it thoroughly before using it: (28/04/2022 - 27/04/2023) (28.04.2022 - 27.04.2023) (28-04-2022 - 27-04-2023) (04/28/2022 - 04/27/2023) (2022/04/28 - 2023/04/27) (2022-04-28 - 2023-04-27) Loop through all line items. Whenever a string in the line item description matches the regex, we replace it with nothing (''). Save the new description for the line item. I hope that makes sense. There's probably a better way to do it but this was what I could with the 20 minutes I had to spare 😄
×
×
  • 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