Found the answer if anyone is interested ?
Now you can add a domain search box to your site that has only the domains that you have in the admin section of your WHMCS , so you don't have to edit the <options lines yourself.
Turning 2 jobs into 1
In a .tpl file add the following :
<form method="post" action="cart.php?a=add&domain=register">
<div class="cartbox" align="center">www.
<input type="text" name="sld" size="40" value="" />
<select name="tld">
{php}
// Make a MySQL Connection
function getDomains()
{
$query = mysql_query("SELECT d.id, d.extension 'tld', t.type, c.code, c.suffix, t.msetupfee FROM tbldomainpricing AS d
INNER JOIN tblpricing AS t ON t.relid = d.id
INNER JOIN tblcurrencies AS c ON c.id = t.currency
WHERE t.type IN ('domainregister','domaintransfer','domainrenew') ORDER BY d.id ASC");
$dataArray=array();
while($row = @mysql_fetch_array($query, MYSQL_ASSOC)) {
$dataArray[$row['tld']][$row['type']]=$row;
}
return $dataArray;
}
$mydata = getDomains();
// echo "<pre>mydata: " . print_r($mydata,TRUE) . "</pre>";
foreach($mydata as $k => $v) { // $k=TLD
echo "<option value='". $k ."'>". $k ."</option>";
echo "\n";
}
{/php}
</select>
<input type="submit" value="Check Availability" class="buttongo" />
</div>
<p align="center"></p>
</form>