neo.ealink Posted September 25, 2013 Share Posted September 25, 2013 Hi, I would like to ask a simple question I have set up some custom fields in my product. In my module, I would like to get that custom fields value. for example : my custom field name is customfield[27], its field name : Customer Code, I understand that in the provisioning module, in order to use that parameter, we have to use following format : $params['customfields']['Field Name'].. below is the list of param that i used to get that custom field value and NONE OF IT WORKS $param['customfields']['customercode']; $param['customfields'][27]; $param['customfields']['customfield[27]']; For the moment, the only thing i can do is that taking the value directly from the "tblcustomfieldsvalues" table (either SELECT / UPDATE) but i think i still want to get the value from what WHMCS has set it via the $param.. Anyone please help.. Below is my sample code (jst to view the value in the log) : function XXX_ChangePackage($params) { logactivity("value from customfields in product/services-admin : ".$param['customfields']['customercode']. $param['customfields'][27].$param['customfields']['customfield[27]']); //ignore below if ($successful) { $result = "success"; } else { $result = "Error Message Goes Here..."; } return $result; } 0 Quote Link to comment Share on other sites More sharing options...
Chrisw Posted September 25, 2013 Share Posted September 25, 2013 var_dump it in your module and send the results to your email address. This way you can properly see what is provided and be sure you are handling "WHMCS" correctly - sorry, best I could offer as I have not been keen on the WHMCS dev side lately. 0 Quote Link to comment Share on other sites More sharing options...
neo.ealink Posted September 25, 2013 Author Share Posted September 25, 2013 var_dump it in your module and send the results to your email address. This way you can properly see what is provided and be sure you are handling "WHMCS" correctly - sorry, best I could offer as I have not been keen on the WHMCS dev side lately. why should i send the results to my email instead of i just displayed it in the log using the logactivity()?? btw, still, all of those variables seems like did not sent / contain any value at all or now,back to the issue, i think the calling of the variable is wrong in my case. I would like to know how to call those custom fields in the provisioning module using the $param['customfields'] ;'( 0 Quote Link to comment Share on other sites More sharing options...
neo.ealink Posted October 1, 2013 Author Share Posted October 1, 2013 It's alright, it is much easier just getting all the values from tblcustomfields and tblcustomfieldsvalues. Previously i did not have the permission to go through the database, but now, it is easier.. 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.