here is an easy way to import your TLD's and pricing directly from your enom reseller account.
make sure you have updated your "Retail" pricing at enom.
<?php
if (!defined("WHMCS"))
die("This file cannot be accessed directly");
if($_POST[action]=='')
{
?>
<form method="post">
<input name="action" value="doimport" type="hidden" />
<input name="enU" type="text" />eNom Username<br />
<input name="enP" type="text" />eNom Password<br />
<br />
<input name="Submit1" type="submit" value="submit" />
</form>
<?
}else{
$url = "http://reseller.enom.com/interface.asp?command=PE_GetRetailPricing&uid={$_POST[enU]}&pw={$_POST[enP]}&responsetype=xml";
$rss = simplexml_load_file($url);
//truncate tbldomainpricing
mysql_query("truncate table tbldomainpricing");
//remove all TLD data from tblpricing table
mysql_query("DELETE FROM `tblpricing` WHERE type='domainregister'");
mysql_query("DELETE FROM `tblpricing` WHERE type='domaintransfer'");
mysql_query("DELETE FROM `tblpricing` WHERE type='domainrenew'");
//now insert eNom Data
$i=0;
foreach ($rss->pricestructure->tld as $item) {
//first insert into tbldomainpricing
$query="INSERT INTO `tbldomainpricing` (`id` ,`extension` ,`dnsmanagement` ,`emailforwarding` ,`idprotection` ,`eppcode` ,`autoreg` ,`order`)
VALUES (NULL , '." . $item->tld . "', '', '', '', '', 'enom', '$i');";
mysql_query($query);
$relid = mysql_insert_id();
//now insert into tblpricing
$query="INSERT INTO `tblpricing` (`id` ,`type` ,`currency` ,`relid` ,`msetupfee` ,`qsetupfee` ,`ssetupfee` ,`asetupfee` ,`bsetupfee` ,`tsetupfee` ,`monthly` ,`quarterly` ,`semiannually` ,`annually` ,`biennially` ,`triennially` )
VALUES (NULL , 'domainregister', '1', '$relid', '" . $item->registerprice . "', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00')";
mysql_query($query);
$query="INSERT INTO `tblpricing` (`id` ,`type` ,`currency` ,`relid` ,`msetupfee` ,`qsetupfee` ,`ssetupfee` ,`asetupfee` ,`bsetupfee` ,`tsetupfee` ,`monthly` ,`quarterly` ,`semiannually` ,`annually` ,`biennially` ,`triennially` )
VALUES (NULL , 'domaintransfer', '1', '$relid', '" . $item->transferprice . "', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00')";
mysql_query($query);
$query="INSERT INTO `tblpricing` (`id` ,`type` ,`currency` ,`relid` ,`msetupfee` ,`qsetupfee` ,`ssetupfee` ,`asetupfee` ,`bsetupfee` ,`tsetupfee` ,`monthly` ,`quarterly` ,`semiannually` ,`annually` ,`biennially` ,`triennially` )
VALUES (NULL , 'domainrenew', '1', '$relid', '" . $item->renewprice . "', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00')";
mysql_query($query);
echo "TLD: ." . $item->tld . " Register: " . $item->registerprice . " Transfer: " . $item->transferprice . " Renew: " . $item->renewprice . " Inserted Into Database<br>";
$i++;
}
}
?>
just add this to a php file, upload it to the whmcs/modules/admin/ directory and access it from utilities -> addon modules.
It only inserts pricing for the 1 year option, but that is all that i needed it to do.
Feel free to customize it to your needs
I have attached a zip file also
Scott
enom_tld_importer.zip