Jump to content

Show Package prices on non-WHMCS pages


Recommended Posts

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

Link to comment
Share on other sites

  • 1 month later...

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

Link to comment
Share on other sites

 

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.
Link to comment
Share on other sites

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.   Paste as plain text instead

  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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated