Jump to content

How do we display the monthly price of an annual billing cycle?


Grafixster

Recommended Posts

I can link to a product and a specific billing cycle choice just fine

 

/cart.php?a=add&pid=1&billingcycle=annually

 

I can also display the same products total cost

 

/feeds/productsinfo.php?pid=1&get=price&billingcycle=annually

 

How do I show the products monthly cost breakdown instead of the total months?

 

I'm using a drop down list where user can choose the billing cycle but I'd like it to show price per month

 

For example

 

List options:

- Monthly $9.99 p/month

- 6 Months $8.49 p/month

- Yearly $8.99 p/month

- 2 Years $7.99 p/month

 

Submt btn

 

As it stands, I'm only able to show the total price and not the p/month price.

 

 

Thanks

Link to comment
Share on other sites

Thanks for the response.

 

I did see your write up when researching and am actually implementing it as I learn the templating system.

 

I should have mentioned that I'm applying what I wrote above to external pages, outside of the WHMCS templating system. Remote landing pages for example.

 

I'm not finished implementing your tutorial into my test install but it leaves me to wonder, would I end up with more variables to use in the jquery call to WHMCS like, your money saved or per month breakdown?

 

Thanks again!

Link to comment
Share on other sites

oh sorry, I missed your mention of using feeds... if this is for external of whmcs, then that's the way to go.

 

what you would have to do is to do a bit of maths in the feed code.. e.g price / months - should be the same as my code, except that is in smarty, but it should be easier with php.

 

$price = $data[$billingcycle];

so divide $price by number of months to get the monthly price... either by calling the feed for each period, or just once (expanding the sql query) and getting the feed to do the outputting..

 

let me know if you run into any problems.

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