ericdstrom Posted April 16, 2014 Share Posted April 16, 2014 Hello, I'm working on a module and need to create a new product either on or around the time of activation. This product needs to have some configurable options associated with it. The problem I'm having is that the API documentation only says that you can specify configoption1, configoption2, etc. It doesn't actually give what the proper syntax is for specifying these things. If anyone has any idea what the proper array structure for this would be, it would be a huge help. Thanks! 0 Quote Link to comment Share on other sites More sharing options...
sentq Posted April 16, 2014 Share Posted April 16, 2014 you create a provisioning module right? so you need to read this guide http://docs.whmcs.com/Provisioning_Module_Developer_Docs 0 Quote Link to comment Share on other sites More sharing options...
ericdstrom Posted April 17, 2014 Author Share Posted April 17, 2014 Even the documentation there is a little vague on custom options and custom fields. "customfields this variable contains a sub-array of all the custom fields defined for the product, with the key being the custom field name - $params[‘customfields’][‘Field Name’]" It shows how those variables get passed to each function, but doesn't allow you an area to define these options, or am I missing something here? 0 Quote Link to comment Share on other sites More sharing options...
sentq Posted April 17, 2014 Share Posted April 17, 2014 download the template.php file it includes all features of provisioning module 0 Quote Link to comment Share on other sites More sharing options...
ericdstrom Posted April 17, 2014 Author Share Posted April 17, 2014 The only thing in there related to custom fields is "$customfields = $params["customfields"];" on line 29. 0 Quote Link to comment Share on other sites More sharing options...
sentq Posted April 17, 2014 Share Posted April 17, 2014 function template_ConfigOptions() { # Should return an array of the module options for each product - maximum of 24 $configarray = array( "Package Name" => array( "Type" => "text", "Size" => "25", ), "Web Space Quota" => array( "Type" => "text", "Size" => "5", "Description" => "MB" ), "FTP Access" => array( "Type" => "yesno", "Description" => "Tick to grant access" ), "Subdomains" => array( "Type" => "dropdown", "Options" => "1,2,5,10,25,50,Unlimited"), ); return $configarray; } i got this from template.php download the complete code from here 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.