friendlytech Posted March 30, 2011 Share Posted March 30, 2011 Hello I am wanting to know how to get the billing cycle drop downs in to a custom page, just so i can show the different prices. Any ideas? Thanks in advance 0 Quote Link to comment Share on other sites More sharing options...
sohouk Posted March 31, 2011 Share Posted March 31, 2011 You can do this a variety of ways, but the easy way is to use Widgets. This single line gets the Annual price for Product with the id of 8 (you get that info from the Setup > Products page of WHMCS.) Just put it where you want the price to appear on your page. <script language="JavaScript" src="widgets/productsinfo.php?pid=8&get=price&billingcycle=annually" type="text/javascript"></script> By changing the billingcyle= parameter, you get different prices. Here is the same which returns the monthly price: <script language="JavaScript" src="widgets/productsinfo.php?pid=8&get=price&billingcycle=monthly" type="text/javascript"></script> Obviously you will need to wrap any text of formatting around the code as all it does is grab the actual figures. You can combine the Widget with direct order links. Here is a full example which provides a Text link to the shopping cart with the annual billing cycle for the product already selected. <span class="heading3"><a href="cart.php?a=add&pid=8&billingcycle=annually">Annual cost </a> <script language="JavaScript" src="widgets/productsinfo.php?pid=8&get=price&billingcycle=annually" type="text/javascript"></script> </span> It looks like this on a web page: Annual Cost £29.99 Annual cost is a link to the cart and £29.99 is picked from the WHMCS data. The big advantage of using Widgets is that it draws the data directly and that if it changes you do not have to recall which pages you need to update. Tip: You can also use Widgets to pick up the product description as well making it all even easier! Trevor 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.