scottcase Posted September 8, 2010 Share Posted September 8, 2010 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 0 Quote Link to comment Share on other sites More sharing options...
Vincent Vega Posted September 8, 2010 Share Posted September 8, 2010 For users, notice the; "remove all TLD data from tblpricing table" All your insrted tld's will be removed when running the script. 0 Quote Link to comment Share on other sites More sharing options...
scottcase Posted September 8, 2010 Author Share Posted September 8, 2010 correct, this will remove any TLD's you have currently configured 0 Quote Link to comment Share on other sites More sharing options...
PedYhtd Posted September 14, 2010 Share Posted September 14, 2010 Ive tryed to use ure script but nutheing happens do i need to turn of my account valadation on enom 0 Quote Link to comment Share on other sites More sharing options...
scottcase Posted September 14, 2010 Author Share Posted September 14, 2010 Yes, you need to have your servers ip address activated for live processing at enom. the script uses api's and if your ip is not set for live processing at enom it will not work 0 Quote Link to comment Share on other sites More sharing options...
JerusaHost- Mark Posted October 10, 2010 Share Posted October 10, 2010 Has anyone done the other options- 2 years... up to 10 years? That would be really helpful! 0 Quote Link to comment Share on other sites More sharing options...
GORF Posted October 21, 2010 Share Posted October 21, 2010 Has anyone done the other options- 2 years... up to 10 years? That would be really helpful! Here you go! It took a bit, but it works like a charm. It can populate over 2500 fields in less than 10 seconds! - Uses CURL instead of simplexml_load_file - You can select if you want to delete the existing records in the database first (if you do not, there probably will be duplicates) - You can select to import 1 year prices - You can select to import 2-4 year prices - You can select to import 5-9 year prices - You can select to import 10 year prices - Automatically ads -1 to disabled fields BACKUP FIRST!!! 0 Quote Link to comment Share on other sites More sharing options...
GORF Posted October 21, 2010 Share Posted October 21, 2010 Updated version: - Round up/down to the nearest dollar while importing - Price changer - change all register and/or transfer and/or renew prices from xx.xx to zz.zz Price changer can be used indepenently of the import functions. . 0 Quote Link to comment Share on other sites More sharing options...
GORF Posted October 21, 2010 Share Posted October 21, 2010 Had a minor fix. Here is the file. enom_tld_importer.zip 0 Quote Link to comment Share on other sites More sharing options...
letsgetmotivated Posted November 10, 2010 Share Posted November 10, 2010 Clever stuff going on here. I downloaded the file and followed what seemed idiot proof instructions. upload it to the whmcs/modules/admin/ directory and access it from utilities -> addon modules. Done all that but no sign of anything in the addon modules menu. Have I missed something? using latest version of WHMCS. Any top tips much appreciated. 0 Quote Link to comment Share on other sites More sharing options...
GORF Posted November 11, 2010 Share Posted November 11, 2010 If you look at the folder structure in the /modules/admin/ folder, you will see other folders inside. Create a folder in /modules/admin/ called enom_tld_importer and upload the file into that folder. /modules/admin/enom_tld_importer/ <- File goes in here. 0 Quote Link to comment Share on other sites More sharing options...
letsgetmotivated Posted November 11, 2010 Share Posted November 11, 2010 (edited) Thanks for reply. Yes I checked the layout of the existing "add ons" and had done as you suggest. Still nothing showing up in the add ons menu. Just having a look at the script to see if having a custom named main ADMIN folder, as prompted at initial WHMCS set up, would affect it. Edited November 11, 2010 by letsgetmotivated 0 Quote Link to comment Share on other sites More sharing options...
letsgetmotivated Posted November 11, 2010 Share Posted November 11, 2010 Ok ok I confess I found the problem and its down to "user error". Somehow managed to delete the .php from the file extension and of course looking in all the wrong places when troubleshooting. Sorted. Thanks for developing this script. 0 Quote Link to comment Share on other sites More sharing options...
letsgetmotivated Posted November 11, 2010 Share Posted November 11, 2010 Got the script working after re-adding .php extension to the file. Dont ask! I have "Enom TLD Importer" now in the addon modules menu however when I run the script it just deletes existing TLDs. Doesnt import anything from Enom. Username and password definately correct and the Enom account is live..... 0 Quote Link to comment Share on other sites More sharing options...
GORF Posted November 12, 2010 Share Posted November 12, 2010 Put this in your browser's address bar and see what the results are. Replace USERNAME/PASSWORD with your Enom username and password. http://reseller.enom.com/interface.asp?command=PE_GetRetailPricing&TLDOnly=1&years=1&uid=USERNAME&pw=PASSWORD&responsetype=xml You should have some XML returned in the browser. 0 Quote Link to comment Share on other sites More sharing options...
letsgetmotivated Posted November 12, 2010 Share Posted November 12, 2010 Thanks. XML returned in browser. Couple of key lines below: <Err1> - <![CDATA[ User not permitted from this IP address - 4 ]]> </Err1> </errors> Does this mean I should be including the IP address of PC using WHMCS used as well as IP address of server in the Enom settings? Thanks again for your help. 0 Quote Link to comment Share on other sites More sharing options...
GORF Posted November 13, 2010 Share Posted November 13, 2010 Yes, whatever IP that will be used to interact with Enom needs to be registered with them. 0 Quote Link to comment Share on other sites More sharing options...
RFEHosting Posted January 3, 2011 Share Posted January 3, 2011 I just installed this on my system, and it seems that the theme for it is not setup correctly, or something.. i go to addon modules and it shows the list of addon modules but it seems the css for it is broken. 0 Quote Link to comment Share on other sites More sharing options...
RFEHosting Posted January 3, 2011 Share Posted January 3, 2011 NVM was in the wrong dir 0 Quote Link to comment Share on other sites More sharing options...
djwmguk Posted January 28, 2011 Share Posted January 28, 2011 Does this script convert from USD to GBP also? I need to install all these but I do need them to import in to GBP otherwise it wont be worth doing it 0 Quote Link to comment Share on other sites More sharing options...
GORF Posted January 29, 2011 Share Posted January 29, 2011 I really do not know. If your Enom is set to GBP and your WHMCS is set to GBP, I think the script will just import the numbers. Backup your database and give it a try. 0 Quote Link to comment Share on other sites More sharing options...
allchurchweb Posted February 17, 2011 Share Posted February 17, 2011 (edited) In case anyone wants to know how to add the IP address: http://supportcenter.custhelp.com/app/answers/detail/a_id/1073/kw/add%20ip%20address Edited February 17, 2011 by allchurchweb 0 Quote Link to comment Share on other sites More sharing options...
allchurchweb Posted February 17, 2011 Share Posted February 17, 2011 Okay, all set up but not working, I've checked the results in XML and they are all coming through, the issue is they are not actually populating the table, so when I go to domain pricing - the table is empty. Any suggestions? 0 Quote Link to comment Share on other sites More sharing options...
allchurchweb Posted February 17, 2011 Share Posted February 17, 2011 It's set up and the direct url displays the XML so I can see that it is working but it does not populate the table in WHMCS no TLDs or prices are added it successfully deletes what is there but does not populate... any suggestions? 0 Quote Link to comment Share on other sites More sharing options...
allchurchweb Posted February 17, 2011 Share Posted February 17, 2011 I can not seem to get this system to work, it's installed and operating the xml results are visible with direct url, even says done.. but no TLD or Prices appear in the actual table. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.