Jump to content

Billing Cycle Drop Downs


Recommended Posts

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

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