Jump to content

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


MattBradley

Recommended Posts

Hi,

 

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) {

print_r($params);

exit;

}

 

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!

 

/http://demo.inventpartners.com/configoptions.png

 

 

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:

 

tblhostingconfigoptions:

 

"id";"relid";"configid";"optionid";"qty"

"1";"1";"1";"0";"1"

"2";"1";"2";"0";"2"

"3";"1";"3";"0";"3"

"4";"1";"4";"0";"4"

"5";"1";"5";"0";"5"

"6";"1";"6";"0";"6"

"7";"1";"7";"0";"2"

"8";"1";"8";"0";"4"

"9";"1";"9";"0";"6"

"10";"1";"10";"0";"8"

 

tblproductconfifoptions

 

"id";"gid";"optionname";"optiontype";"qtyminimum";"qtymaximum";"order";"hidden"

"1";"1";"VDCs";"4";"1";"4";"0";"0"

"2";"1";"Servers";"4";"1";"50";"0";"0"

"3";"1";"CPUs";"4";"1";"100";"0";"0"

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

"5";"1";"Disks";"4";"1";"200";"0";"0"

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

"7";"1";"VLANs";"4";"1";"4";"0";"0"

"8";"1";"Subnets";"4";"1";"8";"0";"0"

"9";"1";"Snapshots";"4";"1";"500";"0";"0"

"10";"1";"Images";"4";"1";"20";"0";"0"

 

tblhosting

 

"id";"userid";"orderid";"packageid";"server";"regdate";"domain";"paymentmethod";"firstpaymentamount";"amount";"billingcycle";"nextduedate";"nextinvoicedate";"domainstatus";"username";"password";"notes";"subscriptionid";"promoid";"suspendreason";"overideautosuspend";"overidesuspenduntil";"dedicatedip";"assignedips";"ns1";"ns2";"diskusage";"disklimit";"bwusage";"bwlimit";"lastupdate"

"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` ,

`tblhostingconfigoptions`.`qty`

FROM

`tblproductconfigoptions` ,

`tblhosting` ,

`tblhostingconfigoptions`

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.

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