Jump to content

WHMCS [configOptions] Pushing to Custom Feilds


derrick1123

Recommended Posts

I'ts been bugging me for a few days, so I decided to try and get some help.

function somestuff_ConfigOptions($params) {
    ini_set("soap.wsdl_cache_enabled", "0");

    $rwsdl = "https://somesite";
    $vwsdl = "https://somesite";

    $rurl = "https://somesite";
    $vurl = "https://somesite";

    $rns = "somestuff";
    $vns = "somestuff";

    $apiuser=somestuff;
    $apikey=somestuff;
    $auth = array ( "username" => $apiuser, "apiKey" => $apikey );

    $soapClient = new SoapClient($rwsdl, array("trace" => 1));
    $oSoapVar= new SoapVar( $auth, SOAP_ENC_OBJECT);
    $oSoapHeader = new SoapHeader($rns, 'RequestCredentials', $oSoapVar);

    try {
	$info = $soapClient->__soapCall('locationList',array(), array(), $oSoapHeader);
    } catch (SoapFault $exception) { return $exception;  }
    $locations=$info->{'locations'};
    $lc = count($locations);

    $llist = "";

    for($i=1;$i<$lc;$i++)
    {
	$llist .= $locations[$i]->{'locationId'}."|".str_replace(",",";",$locations[$i]->{'name'}).",";
    }
$llist .= $locations[0]->{'locationId'}."|".str_replace(",",";",$locations[0]->{'name'});

    $configarray = array(
	"Location" => array( "Type" => "dropdown", "Options" => $llist),
);
    return $configarray;

}

 

It works perfectly as a drop down, which allows me to choose the location I want in the back-end...but I want the users to be able to choose the location.

I would need to be able to push it to Config Fields instead of Module Settings.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.   Restore formatting

  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.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.