Jump to content

Extra Fields in ConfigureProduct.tpl


Recommended Posts

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

Link to comment
Share on other sites

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.
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • 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