Jump to content

Tutorial: How to modify the Recurring Billing Cycle text.


brian!

Recommended Posts

On 1/8/2016 at 10:58 PM, brian! said:

Hi,

 

it assumed you've added the maths code from the first page of this thread - that code comes in two parts, and you change the second part with the above code... the instructions above tells you what code to replace and what to replace it with.

 

you should then have output that should look similar to...

 

 

GNX6nHZ.png

 

 

 

 

to save time for others, i've modified the "Modern" and "Standard_cart" configureproduct.tpl templates from WHMCS v6.20 and will make them available as an attachment below - these should work without a problem... you'll just need to add the language overrides code shown on the first page.

 

i'm not necessarily going to upload an updated release zip after every minor WHMCS update - it should be simple to update manually if required - but if the code starts to fail, i'll post the necessary template changes. :idea:

Modifiy Recurring Cycle Billing v6.20.zip

Hi brian.

I will try but is not working on another currency other than $ with whmcs version: 7.2.3

Link to comment
Share on other sites

On 10/31/2017 at 1:48 PM, kang28ivan said:

I will try but is not working on another currency other than $ with whmcs version: 7.2.3

it should work for all currencies - i've quickly updated the v7.2.3 standard_cart/configureproduct.tpl template to include the code and it's working for multiple currencies - though remember that the product has to be priced in multiple currencies for it to work.

configureproduct.tpl

Link to comment
Share on other sites

On 11/2/2017 at 12:07 AM, brian! said:

it should work for all currencies - i've quickly updated the v7.2.3 standard_cart/configureproduct.tpl template to include the code and it's working for multiple currencies - though remember that the product has to be priced in multiple currencies for it to work.

configureproduct.tpl

Hi Brian thank for update.

Still not working with another currencies for me, if with dollar working properly but not working with another currencies like IDR

I have screenshot for IDR

With $ = http://prntscr.com/h84o2c
With IDR: http://prntscr.com/h84oyw

Link to comment
Share on other sites

Hi @kang28ivan,

1 hour ago, kang28ivan said:

Still not working with another currencies for me, if with dollar working properly but not working with another currencies like IDR

from those screenshots, it looks like it's working to me - there's nothing in the code that would discriminate in terms of currency - e.g only work for one and not the others.

however, I think the issue is to do with your IDR pricing... if you take a look at the USD pricing, for the monthly billing cycle it's $6 per month... but if they pay annually, it's $5.50 per month... therefore there is a saving and the code will show that annual saving ($6).

if you then look at the IDR pricing, it's Rp.50000 per month... but for all the other billing cycles, it's just multiples of Rp.50000 per month - so with your IDR pricing, there is no saving discount for choosing a longer cycle (and if there is no saving, it won't print the Save text).

as a test, change the IDR annual pricing on this product to Rp.500000 and it should then display the saving for that cycle. :idea:

Link to comment
Share on other sites

8 minutes ago, brian! said:

Hi @kang28ivan,

from those screenshots, it looks like it's working to me - there's nothing in the code that would discriminate in terms of currency - e.g only work for one and not the others.

however, I think the issue is to do with your IDR pricing... if you take a look at the USD pricing, for the monthly billing cycle it's $6 per month... but if they pay annually, it's $5.50 per month... therefore there is a saving and the code will show that annual saving ($6).

if you then look at the IDR pricing, it's Rp.50000 per month... but for all the other billing cycles, it's just multiples of Rp.50000 per month - so with your IDR pricing, there is no saving discount for choosing a longer cycle (and if there is no saving, it won't print the Save text).

as a test, change the IDR annual pricing on this product to Rp.500000 and it should then display the saving for that cycle. :idea:

Hi @brian!

Absolutely right, when I try using another currency like EURO, is working good. I think this is just a matter of currency or conversion from IDR.

Thank you very much @brian! I will look into IDR currency to fix this. :)

And I have one question, for Order Summary whether this can display a discount on the second step? http://prntscr.com/h86i4c
usually it appears on step 3, is there any code to display on the second step? like this http://prntscr.com/h86j0f

Link to comment
Share on other sites

  • 9 months later...
5 hours ago, Aris.N. said:

Is working with whmcs 7? 

yes - the precise code might be different in v7.6 (I haven't checked), but the principle will certainly still work.... one day, i'll rewrite it as a hook, but the idea of the tutorial was to give the user the freedom to modify it however they want to.

Link to comment
Share on other sites

  • 9 months later...
  • 1 month later...
On 8/17/2018 at 5:17 AM, brian! said:

yes - the precise code might be different in v7.6 (I haven't checked), but the principle will certainly still work.... one day, i'll rewrite it as a hook, but the idea of the tutorial was to give the user the freedom to modify it however they want to.

working fine with the latest WHMCS. Is it possible to insert the language code into a universal file so it works with all the languages? 

Link to comment
Share on other sites

16 hours ago, WN-Ali said:

Is it possible to insert the language code into a universal file so it works with all the languages? 

do you mean to use the same strings for everyone in the same language, e.g English ? if so, you could just add that text to the template rather than use a Language Override.

if you mean instead of having to create different language override files for each language, whether you can put them all into one file... not really I think is the answer. 🙂

On 22/05/2019 at 03:45, susan said:

in the above modification, how to change the format number from 


format="%.2f"

to 

number_format?

you can use PHP modifiers like number_format directly in Smarty, but I suspect you'd have to use it when outputting the variable rather than as the above code when the calculation is being made.

Link to comment
Share on other sites

13 hours ago, brian! said:

do you mean to use the same strings for everyone in the same language, e.g English ? if so, you could just add that text to the template rather than use a Language Override.

if you mean instead of having to create different language override files for each language, whether you can put them all into one file... not really I think is the answer. 🙂

you can use PHP modifiers like number_format directly in Smarty, but I suspect you'd have to use it when outputting the variable rather than as the above code when the calculation is being made.

Thanks, I think adding the text to the template is good. The free domain variable of the code is not working with the latest WHMCS.

Edited by WN-Ali
Link to comment
Share on other sites

On 18/07/2019 at 00:37, WN-Ali said:

The free domain variable of the code is not working with the latest WHMCS.

yeah, looks like the array is slightly different than it was years ago... it's fixable, but i'll leave it until v7.8 comes out of beta, just in case there are further cart changes in that release that affect this.

Edited by brian!
Link to comment
Share on other sites

  • 1 month later...
On 7/18/2019 at 2:44 AM, brian! said:

yeah, looks like the array is slightly different than it was years ago... it's fixable, but i'll leave it until v7.8 comes out of beta, just in case there are further cart changes in that release that affect this.

Is it possible to display the SAVINGS in % instead of the amount?

Link to comment
Share on other sites

6 hours ago, wirenine said:

Is it possible to display the SAVINGS in % instead of the amount?

I don't see why not, it's just a calculation based on the prices - leave it with me and i'll update after v7.8 goes GA (or as I like to think of it, it's final public beta). ☺️

Link to comment
Share on other sites

  • 9 months later...
On 8/25/2019 at 12:28 PM, brian! said:

I don't see why not, it's just a calculation based on the prices - leave it with me and i'll update after v7.8 goes GA (or as I like to think of it, it's final public beta). ☺️

Hi Brian,

Could you share an modified standard_cart/configureproduct.tpl so i can take an look?

Thx

Link to comment
Share on other sites

  • 4 weeks later...
On 8/17/2018 at 5:47 PM, brian! said:

yes - the precise code might be different in v7.6 (I haven't checked), but the principle will certainly still work.... one day, i'll rewrite it as a hook, but the idea of the tutorial was to give the user the freedom to modify it however they want to.

It will be great if you share this as a hook. Thank you

Link to comment
Share on other sites

  • 4 months later...
  • 3 months later...

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.

×
×
  • 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