divanvanderwatt Posted May 31, 2016 Share Posted May 31, 2016 Hi, Is there a way to make extra fields available to the ConfigureProduct.tpl template? I know this is possible for all the ClientArea templates e.g. function hook_template_variables_example($vars) { $extraTemplateVariables = array(); // set a fixed value $extraTemplateVariables['fixedValue'] = 'abc'; // fetch clients data if available $clientsData = isset($vars['clientsdetails']) ? $vars['clientsdetails'] : null; // determine if client is logged in if (is_array($clientsData) && isset($clientsData['id'])) { $userId = $clientsData['id']; // perform calculation here $extraTemplateVariables['userSpecificValue'] = '123'; $extraTemplateVariables['anotherUserOnlyValue'] = '456'; } // return array of template variables to define return $extraTemplateVariables; } add_hook('ClientAreaPageViewTicket', 1, 'hook_template_variables_example'); Thanks 0 Quote Link to comment Share on other sites More sharing options...
sentq Posted May 31, 2016 Share Posted May 31, 2016 your code seems ok, what fields you need there? 0 Quote Link to comment Share on other sites More sharing options...
divanvanderwatt Posted May 31, 2016 Author Share Posted May 31, 2016 your code seems ok, what fields you need there? The above code is for a ClientArea Template, can't find similar hooks for the ConfigureProduct template in the Ordering forms. 0 Quote Link to comment Share on other sites More sharing options...
sentq Posted May 31, 2016 Share Posted May 31, 2016 this one did http://docs.whmcs.com/Hooks:ClientAreaPageCart'>http://docs.whmcs.com/Hooks:ClientAreaPageCart also this called in all client area pages: http://docs.whmcs.com/Hooks:ClientAreaPage 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted May 31, 2016 Share Posted May 31, 2016 this may or may not be relevant to what you are trying to do with your hook, but there is the option to add custom fields to a product and I mention it in case you are not aware of the option (as I assume you are a new user). http://docs.whmcs.com/Custom_Fields#Product_Custom_Fields Products you create can also have custom fields added to them which are then shown to the user during the order process. This allows you to collect further information specific to an individual product. These are set when configuring a product in Setup > Products/Services > Products/Services > Edit > Custom Fields tab . Some modules require specific fields are setup and will be explained in the documentation for that module. 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.