Jump to content

How to display discounted pricing on order pages?


Ambarella

Recommended Posts

Hello

 

Im pretty new to WHMCS, And im in the process of setting up my WHMCS. Here's my question,

 

I have a discount pricing structure for long term billing cycles,

 

Example -

 

Monthly cost $6.00

 

Annual Cost $60 (Save $12) - $5 P/m

 

Biennially $96 (Save $48 ) - $4 P/m

 

So when it comes to the shopping cart it displays only the billing value and there's no option to display the discount given and the amount he/she saves by going in for 12/24 month plans.

 

Is there any way to add these information next to the billing value ?

 

Many Thanks :)

Link to comment
Share on other sites

which order form template are you using?

 

Hello,

 

Im planing to use either Comparison or verticalsteps

 

if you tick "pricing breakdown" it should display the discounted prices for the payme3nt terms that you've chosen.Works on all orderforms except ajax

 

I tried this but its mainly for offering discounts on coupons. And it won't show the amounts you can save by going for long term plans, next to the chosen billing cycle.

Link to comment
Share on other sites

I thought this was going to be a nightmare to code, but it looks like it's going to be relatively easy - though i've only done a quick test with "Comparison" so far... :)

 

http://prntscr.com/2kkkhh

 

as a rough test of code, i've only changed the first three billing cycles - the savings and price p/m are all calculated in the template... but I believe that i've seen enough to believe this will work, possibly for all order forms - although i'll need to tidy the code up significantly to make it usable for others.

 

I doubt that i'll get to work on this on Sunday, so will hope to finish it quickly on Monday.

Link to comment
Share on other sites

I thought this was going to be a nightmare to code, but it looks like it's going to be relatively easy - though i've only done a quick test with "Comparison" so far... :)

 

http://prntscr.com/2kkkhh

 

as a rough test of code, i've only changed the first three billing cycles - the savings and price p/m are all calculated in the template... but I believe that i've seen enough to believe this will work, possibly for all order forms - although i'll need to tidy the code up significantly to make it usable for others.

 

I doubt that i'll get to work on this on Sunday, so will hope to finish it quickly on Monday.

 

That's really awesome, but does it require external coding and there's no way to this with what's already there on WHMCS ? hmmmmmmmmmm and how to integrate the code into the system ? :/

Link to comment
Share on other sites

That's really awesome, but does it require external coding and there's no way to this with what's already there on WHMCS ? hmmmmmmmmmm and how to integrate the code into the system ? :/

it's not external coding in the sense that you need to buy / install any addons or modules, but you will need to edit one specific template - though it's just replacing one block of existing code with another modified block.

 

don't worry about how to integrate - when i've got the code finished and tested, i'll give you exact instructions on what to change and how - but basically, you'll just copy & paste the code into the template.

 

editing the templates is commonplace and often the quickest and easiest way to achieve something that can't be done via setting changes.

 

unfortunately, you can't configure this from just admin settings - by default, the billing cycle has two display options (depending on whether monthly pricing breakdown is ticked or not)... it either just lists the available cycles (Monthly, Quarterly etc) with a total price; or if breakdown is ticked, it shows "X Month Price - x.xx"

 

what you want to do is a third way - to use a bit of the first method, a bit of the second and display the saving in-between them - if you didn't want to show the saving, then you could do this by enabling monthly breakdown, tweaking the language files and possibly one minor tweak to the template.

 

however, because the saving is not available as a variable, it has to be calculated for each cycle - luckily for you (or thanks to some terrific template planning by Matt :)), all the variables required to perform the calculations are available (that was a pleasant surprise!)... effectively, i'm re-inventing the wheel and creating the above display from its component parts - one advantage being that the output will be more flexible and allow for the inclusion of additional features - such as the one you want of a numeric saving, or possibly a percentage saving.

 

writing the quick test code, I had assumed that the monthly price would always be the minimum cycle - of course, that won't always be the case - so i'll have to modify the code to check for this and act accordingly... not necessarily a nightmare, just adds a little complication that I didn't see at first glance! :roll:

Link to comment
Share on other sites

  • 3 weeks later...

apologies for the delay in updating you with this but I've been very busy - I have the solution working on all of the order form templates as of v5.2.16.. I can see no reason why it shouldn't work on v5.3.3, but i'll check before posting.

 

I've written a tutorial on this and hopefully i'll be able to finish it tomorrow and post in the user contributions forum - i'll add a link to it from this thread.

Link to comment
Share on other sites

apologies for the delay in updating you with this but I've been very busy - I have the solution working on all of the order form templates as of v5.2.16.. I can see no reason why it shouldn't work on v5.3.3, but i'll check before posting.

 

I've written a tutorial on this and hopefully i'll be able to finish it tomorrow and post in the user contributions forum - i'll add a link to it from this thread.

 

I was just abt to ask :) looking fwd to see the addon solution

Link to comment
Share on other sites

i'm afraid that this is going to be slightly delayed as the code doesn't work in v5.3.3 :mad:

 

the code is correct, but it's now generating a Smarty compiler error message:

 

Fatal error: func_get_args(): Can't be used as a function parameter in /includes/classes/WHMCS/Smarty/Compiler.php on line 0

 

the only thing that's changed is the upgrade from v5.2.16 to v5.3.3; i've tried reuploading the Compiler.php file - but it's not made any difference.

 

i've opened a ticket with support - #CMM-802693 - so hopefully there is an issue with the Compiler file that they can solve.

Link to comment
Share on other sites

apologies for the delay with this... now fully tested and working in 5.3.4

 

I hope it's easy to follow! :)

 

http://forum.whmcs.com/showthread.php?85823-Tutorial-How-to-modify-the-Recurring-Billing-Cycle-text&p=363787

 

it basically tells you how to go from using either of the default methods...

 

billingcycle_01_default.png

... to using a customised one fully controlled by you!

 

 

billingcycle_09_comparison.png

Edited by brian!
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