Jump to content

Checkout title input field


geoffb

Recommended Posts

Hi,

 

I would really like to edit the content.checkout.confirm.php file

 

I would like to make the Title field a set of drop down options, you've seen them everywhere. Mr, Mrs, Miss ect rather than the user typing in their title.

 

At the moment its an input field with a value of {$USER.title}.

 

Any help much appreciated.

 

Thanks

G

Link to comment
Share on other sites

In the template file content.checkout.confirm.php, find:

<div><label for="user_title">{$LANG.user.title}</label><span><input type="text" name="user[title]" id="user_title" class="textbox capitalize" value="{$USER.title}" /></span></div>

Change to:

<div><label for="user_title">{$LANG.user.title}</label>
  <span><select name="user[title]" id="user_title" class="textbox">
    <option value="Mr." {if $USER.title == "Mr."}selected{/if}>$USER.title</option>
-- Repeat for each additional option --
  </select></span>
</div>

This is a hard-coded solution for the skin. There is also the file content.addressbook.php file.

Link to comment
Share on other sites

Hi bsmither,

 

again, thanks very much works like a treat, just wondering if I have the following:

<div><label for="user_title">{$LANG.user.title}</label>
            <span><select name="user[title]" id="user_title" class="textbox">
            <option value="Mr." {if $USER.title == "Mr."}selected{/if}>Mr</option>
            <option value="Mrs." {if $USER.title == "Mrs."}selected{/if}>Mrs</option>
            <option value="Miss." {if $USER.title == "Miss."}selected{/if}>Miss</option>
            <option value="Ms." {if $USER.title == "Ms."}selected{/if}>Ms</option>
            <option value="Dr." {if $USER.title == "Dr."}selected{/if}>Dr</option>
            <option value="Rev." {if $USER.title == "Rev."}selected{/if}>Rev</option>
            <option value="Other." {if $USER.title == "Other."}selected{/if}>Other</option>
            </select></span>
  </div>

I have also added a JS function by where if the user chooses 'Other' then a new field opens (basically the old one as below and the user can add their own title

<div class="other" style="display:none;"><label for="user_title">Other</label><span><input type="text" name="user[title]" id="user_title" class="textbox capitalize" value="{$USER.title}" /></span></div>

although I'm not too sure if this will be saved properly into the system as I have just edited my test customer and added Sir into the Other field and the account in admin still says Mr

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.

×
×
  • Create New...