Difference between revisions of "Linking to WHMCS"
Durohosting (talk | contribs) (→Order Links) |
Durohosting (talk | contribs) (→Order Links) |
||
Line 7: | Line 7: | ||
You can obtain direct order links for products from the product configuration screen. A direct order link takes the user straight into step two of the order process with the product or service preselected. This is used for order links on your site for specific products. The link looks something like this: | You can obtain direct order links for products from the product configuration screen. A direct order link takes the user straight into step two of the order process with the product or service preselected. This is used for order links on your site for specific products. The link looks something like this: | ||
− | http://durohosting.com | + | http://durohosting.com/cart.php?a=add&pid=1 |
You can also link directly to an individual product group. The link looks something like this: | You can also link directly to an individual product group. The link looks something like this: | ||
− | http://durohosting.com | + | http://durohosting.com/cart.php?&gid=2 |
To link to a specific order form template. The link looks something like this: | To link to a specific order form template. The link looks something like this: | ||
− | http://durohosting.com | + | http://durohosting.com/cart.php?carttpl=Orden |
==Setting the Language/Template via the URL== | ==Setting the Language/Template via the URL== |
Revision as of 20:38, 8 June 2009
It is very common for users of WHMCS to want to link to WHMCS from their website. This can be in the form of an order link, or with a form that either takes the user straight to the domain checking process to check the availability of the domain they want or to login.
With WHMCS, this is made easy as all the code you need is provided to you customised and ready to insert into your website by simply going to Utilities > Integration Code.
Contents
Order Links
You can obtain direct order links for products from the product configuration screen. A direct order link takes the user straight into step two of the order process with the product or service preselected. This is used for order links on your site for specific products. The link looks something like this:
http://durohosting.com/cart.php?a=add&pid=1
You can also link directly to an individual product group. The link looks something like this:
http://durohosting.com/cart.php?&gid=2
To link to a specific order form template. The link looks something like this:
http://durohosting.com/cart.php?carttpl=Orden
Setting the Language/Template via the URL
You can set the language or template to be displayed to the user with the link you use to WHMCS. This is done with links such as:
http://demo.whmcs.com/index.php?systpl=portal
http://demo.whmcs.com/index.php?language=Spanish
http://demo.whmcs.com/index.php?systpl=portal&language=Spanish
http://demo.whmcs.com/cart.php?systpl=portal&language=English&gid=1
http://demo.whmcs.com/cart.php?systpl=portal&language=Spanish&a=add&pid=1
These can be combined, used on any page and used with the direct order links
Specifying Currency in a link
You can link to the order form with a specific currency by simulating what the form shown for currency selection does:
http://demo.whmcs.com/index.php?cart.php?currency=1
http://demo.whmcs.com/index.php?cart.php?currency=1&language=Spanish
Showing Announcements on your Site
You can display the announcements on any page of your site using the code below. This will display the latest 3 announcements set to published status.
<?php include("support/dbconnect.php"); include("support/includes/functions.php"); $query = "SELECT * FROM tblannouncements WHERE published='on' ORDER BY date DESC LIMIT 0,3"; $result = mysql_query($query); while ($data = mysql_fetch_array($result)) { $id = $data["id"]; $date = $data["date"]; $title = $data["title"]; $announcement = $data["announcement"]; $date = fromMySQLDate($date); echo("<p><font color=#cccccc>$date</font> - <b>$title</b><br>$announcement</p>"); } ?>
You should replace the word support in the first two lines where it includes files from the WHMCS folder with the path to your WHMCS directory.
Showing The Login Form on your Site
You can display the login form on any page of your site using the code below. This will display the required login form to login to the WHMCS Client Area.
<form method="post" action="http://www.yourdomain.com/whmcs/dologin.php?goto=clientarea"> Email Address: <input type="text" name="username" size="50"> Password: <input type="password" name="password" size="20"> <input type="submit" value="Login"> </form>
You should replace the URL of the form action to the path to your WHMCS directory.