kang28ivan Posted October 31, 2017 Share Posted October 31, 2017 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... 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. 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 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted November 1, 2017 Author Share Posted November 1, 2017 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 0 Quote Link to comment Share on other sites More sharing options...
kang28ivan Posted November 9, 2017 Share Posted November 9, 2017 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 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted November 9, 2017 Author Share Posted November 9, 2017 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. 0 Quote Link to comment Share on other sites More sharing options...
kang28ivan Posted November 9, 2017 Share Posted November 9, 2017 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. 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 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted November 10, 2017 Author Share Posted November 10, 2017 0 Quote Link to comment Share on other sites More sharing options...
Aris.N. Posted August 17, 2018 Share Posted August 17, 2018 Awesome!! Is working with whmcs 7? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted August 17, 2018 Author Share Posted August 17, 2018 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. 0 Quote Link to comment Share on other sites More sharing options...
susan Posted May 22, 2019 Share Posted May 22, 2019 in the above modification, how to change the format number from format="%.2f" to number_format? 0 Quote Link to comment Share on other sites More sharing options...
wirenine Posted July 16, 2019 Share Posted July 16, 2019 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? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted July 17, 2019 Author Share Posted July 17, 2019 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. 0 Quote Link to comment Share on other sites More sharing options...
wirenine Posted July 17, 2019 Share Posted July 17, 2019 (edited) 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 July 17, 2019 by WN-Ali 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted July 18, 2019 Author Share Posted July 18, 2019 (edited) 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 July 19, 2019 by brian! 1 Quote Link to comment Share on other sites More sharing options...
wirenine Posted August 25, 2019 Share Posted August 25, 2019 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? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted August 25, 2019 Author Share Posted August 25, 2019 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). ☺️ 2 Quote Link to comment Share on other sites More sharing options...
Oxzhot Posted June 10, 2020 Share Posted June 10, 2020 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 0 Quote Link to comment Share on other sites More sharing options...
Sonu2007 Posted July 6, 2020 Share Posted July 6, 2020 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 0 Quote Link to comment Share on other sites More sharing options...
Persis Host Posted November 21, 2020 Share Posted November 21, 2020 Hi brain I really need this as hook. thanks 0 Quote Link to comment Share on other sites More sharing options...
bendrop Posted March 5, 2021 Share Posted March 5, 2021 @brian! did you ever get this hook done? Gonna upgrade my install tomorrow and was wondering whether I need to write this myself or not... 😁 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.