R-n-R Posted October 20, 2008 Share Posted October 20, 2008 I have searched unsuccessfully for the answer to this question on the forum. So maybe some one has a solution to my question When I set up a product/service in WHMCS, like a hosting package for instance, and I provide multiple choices for the Billing Cycle (Monthly, Quarterly, Semi Annually etc) and on the Shopping cart order page it seems the default payment cycle is always the lowest. What I would like to be able to determine the default showing in the drop down payment cycle list. Is there a trick or tip on getting this done? 0 Quote Link to comment Share on other sites More sharing options...
jozeph Posted October 21, 2008 Share Posted October 21, 2008 This is an important feature. Will be great to have this included on WHMCS. Request this as feature and you have my vote! 0 Quote Link to comment Share on other sites More sharing options...
barwin Posted November 6, 2008 Share Posted November 6, 2008 I would really like to see this feature too ... has anybody discovered a workaround? My thought was to go into the templates and edit 'configureproduct.tpl' -- there's a block of smarty code in there (http://www.smarty.net) that sets which billing cycle should be selected in the dropdown menu. However, it seems that the smarty variable "$billingcycle" is getting set to 'monthly' somewhere in the encrypted PHP code, and we're NOT able to override it in the smarty code without breaking functionality. If I'm mistaken, let me know .. but as of yet I don't believe it's possible for us to workaround this feature gap. Thanks, Ben Arwin EcoSnap, Inc http://www.ecosnap.com 0 Quote Link to comment Share on other sites More sharing options...
barwin Posted November 6, 2008 Share Posted November 6, 2008 I may have found a workaround after all ... it's not ideal, but it will do the trick. First, a description of my setup: I am using the 'boxes' style order form with WHMCS v3.7.2. We have two billing cycle options for our customers: "monthly" and "annually". I want "annually" to be the default, but whmcs defaults to monthly" Here are the steps I took to make "annually" the default during the order process. Edit templates/boxes/configureproduct.tpl Around line 28, you will find the block of code that generates the billing cycle options for the dropdown menu. Each option has an inner {if} block to determine if that particular option should be selected. Since I want "annually" to be default, I changed that particular line to have the following inner {if} statement: ORIGINAL: {if $billingcycle eq "annually"} selected="selected"{/if} NEW: {if $billingcycle eq "annually" or $smarty.post.billingcycle eq ""} selected="selected"{/if} Now, you also have to modify the inner {if} block for 'monthly' (or whatever your lowest billing cycle is), otherwise you'll end up with a dropdown with two elements selected. Just remove the inner {if} block for monthly. It's not needed because the dropdown will always highlight the first element in the options list if no others are explicitely set to 'selected.' Remove this block, but keep everything else on that line: {if $billingcycle eq "monthly"} selected="selected"{/if}> DISCLAIMER: I make no warranty as to the validity of this code. Use at your own risk! It's offered "as-is" in hopes that it will solve your problem as it has mine. I have not tested with any versions other than 3.7.2. Be sure to test extensively before using in a live environment. If you're unsure at all, don't use it! Or check with WHMCS directly. cheers, Ben Arwin EcoSnap, Inc. http://www.ecosnap.com 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.