Eduardo G. Posted July 14, 2015 Share Posted July 14, 2015 Hi! Even if I set a default country in admin area (Setup > Localisation), when a client signs up directly (register.php), the default country selected is United States. I think this is a bug. When client registers from cart, during an order, it works fine. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted July 14, 2015 Share Posted July 14, 2015 Hi, Hi! Even if I set a default country in admin area (Setup > Localisation), when a client signs up directly (register.php), the default country selected is United States.I think this is a bug. I think this is one of those weird WHMCS situations that floats somewhere between being a bug and a feature request. i've just had a look at the v6 template code, and it's intentionally coded to default to the United States... <div class="form-group"> <label for="country" class="control-label">{$LANG.clientareacountry}</label> <select id="country" name="country" class="form-control"> {foreach from=$clientcountries key=thisCountryCode item=thisCountryName} <option value="{$thisCountryCode}" {if $thisCountryCode eq "US"}selected="selected"{/if}>{$thisCountryName}</option> {/foreach} </select> </div> so the argument against it being a real bug is that you can easily go into the template (clientregister.tpl) and replace "US" in the {if} statement with your country code, e.g "GB" for United Kingdom - v5.3 doesn't specify any country as default, it just lists them in the country dropdown starting with Afghanistan... you could make v6 do the same by removing the {if} statement from the above code... {if $thisCountryCode eq "US"}selected="selected"{/if} When client registers from cart, during an order, it works fine. the reason why it works in the order forms, but doesn't in register.php is because the default country value is passed to two Smarty variables in the order form, but isn't passed at all in the registration form - if the value was passed, then you could make the default country choice automatic on the registration page... so perhaps that's a bug, an oversight or by intentional design - the only way to determine that would be to post this as a Bug Report (with a link back to this thread) and let WHMCS Nate (or one of his colleagues) ponder on it. so short-term solution would be to modify your clientregister.tpl template and change "US" to your preferred country code. you could make an action hook that would create a Smarty variable to pull the default country code from the database and then use that in the registration form, but it would probably be quicker for now to just modify the template with the preferred country code. if you report it as a bug, and WHMCS see it as such, they may make the default country code variable available to the registration template and modify the {if} statement accordingly. 0 Quote Link to comment Share on other sites More sharing options...
Eduardo G. Posted July 14, 2015 Author Share Posted July 14, 2015 (edited) Yes, looks like an oversight, I'll open a bug. Thanks, @brian!, great answer. P.S. Opened a bug: http://forum.whmcs.com/showthread.php?103139-v6-Default-country-hardcoded-on-uer-registration Edited July 14, 2015 by egrueda 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.