Jump to content

$params['configoptions'] array empty on module_CreateAccount()


Recommended Posts



I've been working on a WHMCS provisioning module which uses a number of of configoptions.


We've set the configurable options up in the Settings->Configurable Options pane, and added them to the product in Setup > Products/Services. I can post screen grabs if required. We have 10 "value" options set up for the product.


When I add my product to a Client, the configurable options appear in the Product page, and I can set some numeric values for them. However, when I hit the "Create" button, none of the values are passed through.


just so I could check I wasn't imagining things, I changed the [modulename]_createAccount() function in my module to check:


[modulename]_CreateAccount($params) {





The output is as follows:




[accountid] => 1


[configoption1] => 1.25


[customfields] => Array




[configoptions] => Array




... etc



Where have my configoptions gone???


This used to work, but since an upgrade to 5.0.3, the configoptions are gone. We've also tried installing an older version 4.5.2, but we still can't see the configoptions.


Any suggestions, please?


We've tried this in 5.0.3

Link to comment
Share on other sites

Are you sure the config options were present in the order?


Thank you. Yes. Here's a screengrab of the order with the configurable options when I go to view the order. As you can see, the values are being populated, so they must be in the DB somewhere!





You can also verify they are actually in the database.


I can't look in the database right now, but we're installing another test install this week, and I'll have more DB access.

Link to comment
Share on other sites

You can also verify they are actually in the database.


Yes. they are definitely in the database:






















"4";"1";"RAM (GB)";"4";"1";"1000";"0";"0"


"6";"1";"Storage (GB)";"4";"1";"10000";"0";"0"









"1";"1";"1";"1";"0";"2012-02-02";;;"0.00";"0.00";"Free Account";"0000-00-00";"0000-00-00";"Active";;"0RnF1WU0kvrymIhKamAMRHoQOQkqltU4OQvw1OCJ";;;"0";;;"0000-00-00";;;;;"0";"0";"0";"0";"0000-00-00 00:00:00"


Still no data arriving in my $params[] array - this is the 3rd installation I have tried now.

Link to comment
Share on other sites

I have found that if I do:



$query = 'SELECT

`tblproductconfigoptions`.`optionname` ,



`tblproductconfigoptions` ,

`tblhosting` ,


WHERE `tblhosting`.`orderid` = ' . $serviceid . '

AND `tblhosting`.`id` = `tblhostingconfigoptions`.`relid`

AND `tblhostingconfigoptions`.`configid` = `tblproductconfigoptions`.`id`';


$result = mysql_query($query);

while($result_row = mysql_fetch_assoc($result)){

$params['configoptions'][$result_row['optionname']] = $result_row['qty'];




... I can get my configoptions back. Interesting

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.

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