Jump to content

Recommended Posts

you can specify default state for any country by editing the following file:

open this file for editing: /templates/orderforms/boxes/viewcart.tpl

 

replace this line:

<input type="text" name="state" id="inputState" value="{$clientsdetails.state}" class="form-control"{if $loggedin} disabled="disabled"{/if} />

 

with this line:

<input type="text" name="state" id="inputState" value="{if $clientsdetails.state}{$clientsdetails.state}{else}{if $country=="US"}Alaska{/if}{/if}" class="form-control"{if $loggedin} disabled="disabled"{/if} />

 

replace Alaska with valid state name, the new line will display client choice if provided, or it will check if selected/default country is US so it will display Alaska as default option.

 

you can add extra countries default selection like below:

 

<input type="text" name="state" id="inputState" value="{if $clientsdetails.state}{$clientsdetails.state}{else}{if $country=="US"}Alaska{/if}{if $country=="GB"}Barnet{/if}{if $country=="FR"}Calvados{/if}{/if}" class="form-control"{if $loggedin} disabled="disabled"{/if} />

Link to comment
Share on other sites

Marvelous! Thanks @sentq - works flawless!

 

Hey, might you be able to point me into the right direction on howto remove confirm password input field from validation? Exclude it, so that customer doesn't need to type password twice.

 

in the viewcart.tpl, there is some PHP code (around line #383) that looks like this:

 

<div id="newPassword2" class="form-group has-feedback">
   <label for="inputNewPassword2" class="col-sm-5 control-label">{$LANG.clientareaconfirmpassword}</label>
   <div class="col-sm-6 col-md-5">
       <input type="password" name="password2" id="inputNewPassword2" value="{$password2}" class="form-control" />
       <span class="form-control-feedback glyphicon"></span>
       <div id="inputNewPassword2Msg">
       </div>
   </div>
</div>

 

p.s. - tried using this guys code, but for some reason it didn't work -- https://forum.whmcs.com/showthread.php?67554-Remove-Confirm-Password-on-Sign-Up&p=293183#post293183 -- i even tried adding ID to <form> and played around with it, like removed {literal} and also comparing the modern order form to boxes - no luck though

Edited by USA_Webmaster
forgot to explain myself more clearly
Link to comment
Share on other sites

first hide password confirm block by adding style="display:none;" to the main div containing this field:

<div id="newPassword2" class="form-group has-feedback" style="display:none;">

 

now, copy this Javascript code inside the same file or inside checkout.js:

$(document).ready(function() {
   $("#inputNewPassword1").on("keyup", function() {
       $("#inputNewPassword2").val($("#inputNewPassword1").val());
    });
});

 

it will simply replicate what's in field 1 inside field 2 every time client is pressing keyboard keys

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