iPH - Sriram Posted May 23, 2009 Share Posted May 23, 2009 Hi All, Now that we have multi-currency support, i was wondering is there is a way so that we can pull and display the package prices on non-whmcs pages. The idea here is, i've a completely dedicated url xyz.com where i have installed WHMCS. It is configured to use USD and INR. (USD being primary) My hosting website is abc.com. Now as the exchange rates are being updated everyday, i can't keep changing the prices on the static website abc.com everyday. So i want to make it dynamic by pulling the package prices from whmcs so that whenever the prices are updated with the current exchange rates, it shd reflect on the static pages. Any other idea to implement this is also appreciated. Regards, Sri 0 Quote Link to comment Share on other sites More sharing options...
50gigs Posted July 19, 2009 Share Posted July 19, 2009 quck how to make a file called dbconnect.php <?php mysql_connect("localhost", "database user", "password") or die(mysql_error()); mysql_select_db("database-name") or die(mysql_error()); ?> add in the database user and pw and database name in the right sections Save it. on any page you want to pull up the plan price add this <?php include("dbconnect.php"); ?> to get the pricing info from the whmcs database. $result = mysql_query( 'SELECT `tblpricing`.`annually`'. ' FROM tblpricing'. ' WHERE ((`tblpricing`.`relid` =25) AND (`tblpricing`.`currency` =1))'. ' LIMIT 0, 30 ') or die(mysql_error()); $row = mysql_fetch_assoc($result); echo $row['annually']; alter below to change product relid is the product code number = pid number Show different currency. change currency from 1 (1 is the default or first currency you entered) Also add your domain to the mysql remote hosts for the domain hosting your whmcs db 0 Quote Link to comment Share on other sites More sharing options...
BAJI26 Posted July 19, 2009 Share Posted July 19, 2009 This is better: http://forum.whmcs.com/showthread.php?t=21122 0 Quote Link to comment Share on other sites More sharing options...
HostOrca Posted July 20, 2009 Share Posted July 20, 2009 This is better: http://forum.whmcs.com/showthread.php?t=21122 Yes but the OP wants to display it on his main site, which is seperate from his whmcs install. Sparky's mod will only work within whmcs Note: This works currently only within WHMCS. Some editing is required in your template file. There is an example template available to give you an idea of how to use the variables included. 0 Quote Link to comment Share on other sites More sharing options...
BAJI26 Posted July 20, 2009 Share Posted July 20, 2009 Yes but the OP wants to display it on his main site, which is seperate from his whmcs install. Sparky's mod will only work within whmcs Opps! Brain didn't process that part! 0 Quote Link to comment Share on other sites More sharing options...
50gigs Posted July 23, 2009 Share Posted July 23, 2009 we wanted the same thing - to pull info from the whmcs db and use on another domain. Hence the weekend job 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.