Drecca Posted June 8, 2016 Share Posted June 8, 2016 I have a developer significantly customizing my WHMCS install, and some features I wanted added (interface, mostly) are apparently not possible because WHMCS does not allow PHP to run within the client area / order form templates. I'm not a developer so this is the first time I hear of this. Is there a way around this? 0 Quote Link to comment Share on other sites More sharing options...
sentq Posted June 8, 2016 Share Posted June 8, 2016 use ActionHooks 0 Quote Link to comment Share on other sites More sharing options...
twhiting9275 Posted June 8, 2016 Share Posted June 8, 2016 WHMCS does allow the code, but it is turned off by default, and will likely be removed in future releases. Without knowing specifics, it's kind of hard to make recommendations, but there is a way to assign variables to the WHMCS template after running php code, and yes, hooks will help you. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted June 9, 2016 Share Posted June 9, 2016 depending on what your developer is trying to do, and where, Smarty might be another possible option - although if it needs to be written using PHP, then using hooks would be the better way... but Tom's correct that without details, it's hard to advise other than generally. 0 Quote Link to comment Share on other sites More sharing options...
Drecca Posted June 13, 2016 Author Share Posted June 13, 2016 Hi Guys, Thanks for the feedback! Here's what I'm trying to do for now 1 - I have a very customized client theme. But I want to be able to show customers which page they are actually on by having the icon linked to that page lit up. I.e : If they're on the support page, I want the icon i have for "support" to be a different color. I know how to do this outside of WHMCS, but need PHP within WHMCS to recognize which page the customer is on to do it. 2 - I'm building a customized order form, and some functions rely on running PHP in them. Some of these include different calculations for line items. Domain checks, etc, not all of them available in WHMCS, so I want to be able to run some php code in there. Doable? 0 Quote Link to comment Share on other sites More sharing options...
sentq Posted June 13, 2016 Share Posted June 13, 2016 Hi Guys, Thanks for the feedback! Here's what I'm trying to do for now 1 - I have a very customized client theme. But I want to be able to show customers which page they are actually on by having the icon linked to that page lit up. I.e : If they're on the support page, I want the icon i have for "support" to be a different color. I know how to do this outside of WHMCS, but need PHP within WHMCS to recognize which page the customer is on to do it. 2 - I'm building a customized order form, and some functions rely on running PHP in them. Some of these include different calculations for line items. Domain checks, etc, not all of them available in WHMCS, so I want to be able to run some php code in there. Doable? as I said before, you can use ActionHook function to run your PHP logic, then pass the result to smarty, so it will be the same as adding PHP in templates directly but more stable. simple example: <?php add_hook("ClientAreaPage", 1, function($vars){ if ($vars['filename']=="submitticket"){ $pageIcon = "ticket.png"; } return array("pageicon" => $pageIcon); }); 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.