View Single Post
  #1  
Old 10-03-2006, 12:39 PM
 
QVS QVS is offline
 

Senior Member
  
Join Date: Nov 2004
Posts: 136
 

Default Tidy up registration

I had complaints about having to fill in your name too many times on registration etc. So heres the code to clean it up, see link below to see how it looks.
http://www.qvsdirect.com/reg_x-cart.jpg

THIS HAS BEEN DONE FOR VERSION 4.014



1. <xcart_dir>/skin1/main/register_billing_address.tpl:

replace

{if $default_fields.title.avail eq 'Y'}
<TR>
<TD align="right">{$lng.lbl_title}</TD>
<TD>{if $default_fields.title.required eq 'Y'}<FONT class="Star">*</FONT>{else}&nbsp;{/if}</TD>
<TD nowrap>
<SELECT name="b_title">
{section name=title loop=$name_titles}
<OPTION {if $userinfo.b_title eq $name_titles[title]}selected{/if}>{$name_titles[title]}</OPTION>
{/section}
</SELECT>
</TD>
</TR>
{/if}

{if $default_fields.firstname.avail eq 'Y'}
<TR>
<TD align="right">{$lng.lbl_first_name}</TD>
<TD>{if $default_fields.firstname.required eq 'Y'}<FONT class="Star">*</FONT>{else}&nbsp;{/if}</TD>
<TD nowrap>
<INPUT type="text" name="b_firstname" size="32" maxlength="32" value="{$userinfo.b_firstname}">
{if $reg_error ne "" and $userinfo.b_firstname eq "" && $default_fields.firstname.required eq 'Y'}<FONT class="Star">&lt;&lt;</FONT>{/if}
</TD>
</TR>
{/if}

{if $default_fields.lastname.avail eq 'Y'}
<TR>
<TD align="right">{$lng.lbl_last_name}</TD>
<TD>{if $default_fields.lastname.required eq 'Y'}<FONT class="Star">*</FONT>{else}&nbsp;{/if}</TD>
<TD nowrap>
<INPUT type="text" name="b_lastname" size="32" maxlength="32" value="{$userinfo.b_lastname}">
{if $reg_error ne "" and $userinfo.b_lastname eq "" && $default_fields.lastname.required eq 'Y'}<FONT class="Star">&lt;&lt;</FONT>{/if}
</TD>
</TR>
{/if}


with


<input type="hidden" name="b_title" value="">
<input type="hidden" name="b_firstname" value="">
<input type="hidden" name="b_lastname" value="">

and replace

<TR>
<TD height="20" colspan="3"><B>{$lng.lbl_billing_address}</B><HR size="1" noshade></TD>
</TR>

with

{if $action ne 'cart'}
<TR>
<TD height="20" colspan="3"><B>{$lng.lbl_billing_address}</B><HR size="1" noshade></TD>
</TR>
{/if}


2. <xcart_dir>/skin1/customer/main/register.tpl:

find the following line:

function check_registerform_fields() {ldelim}

and insert the code below after that line


{if $default_fields.title.avail eq 'Y' and $action eq 'cart'}
document.registerform.b_title.value = document.registerform.title.value;
{/if}
{if $default_fields.firstname.avail eq 'Y' and $action eq 'cart'}
document.registerform.b_firstname.value = document.registerform.firstname.value;
{/if}
{if $default_fields.lastname.avail eq 'Y' and $action eq 'cart'}
document.registerform.b_lastname.value = document.registerform.lastname.value;
{/if}




Hope it helps a few people.
__________________
xcart version 4.1.6
UK - Brighton

QVS ELECTRICAL SUPPLIES - http://www.qvsdirect.com

We supply a huge range of cables, electrical accessories, heating, ventilation, fire and security products, consumer units & circuit distribution, indoor and outdoor lighting, showers and water heating, tools and fixings, timer switches, sockets, switches, air conditioning, trunking, and much much more.
Reply With Quote