Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


SeanP last won the day on April 28 2014

SeanP had the most liked content!

Community Reputation

3 Neutral

About SeanP

  • Rank
    Level 2 Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. I was using the internal API. The API call worked fine, until I added the "deleteusers" and "deletetransactions" parameters. When I added those, I got the "Call to undefined function checkPermission" error message. I tried without a user, and also with a user that had full API rights.
  2. Thanks! I may have to just mention the discount was applied using the if statement logic you provided. It would really be nice to calculate the actual total, but it makes it a little tough when most of the template is just a {$order_details} tag! I setup a discount for a client, and on the first order they immediately contacted me about this notification having the wrong total.
  3. Thanks for all the help! I'm starting to figure out where things are. I've gotten most of my code moved to modules/hooks now. Based on what you just said, it sounds like I'm on the right track and using the correct hook points.
  4. I have a client assigned to a client group that has a discount on it. Their discount gets applied to their invoices, but the "Order Confirmation" email template does not show the discount. This causes some confusion, as they see this email and think they didn't receive the discount. Is there any way to add the discount to this email template, if the client in fact has a discount?
  5. I found the following post, and assume this would work for each of the templates I listed:
  6. Is there a list of template files and the corresponding hooks that execute when that template is called? I am going through the hook index documentation, but it's not always easy to figure out which hook to use on a specific template. I am upgrading an old version of WHMCS, and moving code from {php} tags in templates to hooks. For instance, I need to create hooks for the following template files in the shopping cart: complete.tpl configureproduct.tpl products.tpl viewcart.tpl They are not specific to a particular function, I just need to run hooks to generate template tags for each of those templates.
  7. Hey brian!, I really appreciate you pointing me in the right direction. I was able to accomplish what I needed within a hook. I've got a lot more to go, but now have a good idea how proceed. Thank you!
  8. I was trying to convert some PHP I have in {php} tags in templates to hooks. However, I need do a DB query for each service in the clientareaproducts.tpl within the following for loop: {foreach key=num item=service from=$services} How to I query each service, then use the template variables in the template? I am fine with keeping the {php} tag in the template for this (I am the designer and developer of my site), but I get an error trying to use PDO in the {php} tags ("ParseError: syntax error, unexpected 'use' (T_USE)": use WHMCS\Database\Capsule; // Get PDO for the database queries $pdo = Capsule::connection()->getPdo(); How to I either use PDO in the {php} tag or move this to a hook and still be able to do a DB query for each service?
  9. Thanks for the reply. So, it sounds like it might be more procedural (best practice), to help ensure the roles (developer, designer, etc) are clearly defined and protected. If the developer and designer are the same, it might be a moot point, but still would be best practice to divide the template code and PHP code for future separation of those roles. I was unsure if there were possible vulnerabilities from external hacks, or something that would make the PHP code less secure if executed through the template as apposed to a hook.
  10. I know it is not recommended to use PHP tags in the Smarty templates, and that it poses risks to do so. However, I'm not 100% sure what exactly those risks would be. Can someone please elaborate on what the specific risks are in using PHP within the templates?
  11. Thanks for the reply. I figured it would probably have to be done in javascript. I need to see if it is possible based on my current configurable options. I appreciate the help.
  12. I have a particular configurable option for a product that I need to force selection of, based on the selections made of the other configurable options. ------------------------------ Example: Option 1: A (selected) Option 2: B (selected) Option 3: C (selected) Forced Option 4: ABC (force selected) Changing the options: Option 1: B (selected) Option 2: C (selected) Option 3: A (selected) Forced Option 4: BCA (force selected) ------------------------------ I know the Order Summary is updating on the fly when selecting product options, and I'm wanting to dynamically have it select the proper option on the forced configurable option so the order summary looks correct. Also, the one configurable option I want to force is hidden on the form, the others you select are not. I'm not sure if that will make a difference in trying to force it.
  13. This is a good temporary workaround, but could possibly cause an issue for those who have monthly reoccurring invoices that do not use the credit card gateway this hook forces. WHMCS needs to fix this, as it is a security issue where you could end up with full credit cards numbers in your database without even knowing it. If your server is not PCI compliant, and instead you are relying on a token payment gateway to alleviate the need for PCI compliance on your end, this is an issue.
  14. So, in order to work around some broken (and possible security risking) functionality, that WHMCS insists is intended functionality, I have the need to execute PHP code at different times on the template page load of an addon module. In the past, this could be accomplished by executing PHP code using the "{php}" tags at different places during the page load. I basically need to execute PHP code at the start of the addon's template page load, then after the template page is fully loaded (at the end of the load). How is this accomplished when using hooks to execute all of the PHP code?
  • 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