Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Tidy up registration

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #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
  #2  
Old 10-04-2006, 02:29 AM
 
daveb1 daveb1 is offline
 

eXpert
  
Join Date: Sep 2003
Location: Brighton, UK
Posts: 222
 

Default Re: Tidy up registration

works great on 4.0.12 as well.

Good mod QVS!
__________________
Quiet please... I'm trying to unscramble my brian.

http://lizzybug.co.uk (live, minor mods, 4.0.15)
EZCheckout/EZUpsell (Must have mods!) Firetank's Featured Products Manager, and loads of little mods off the forum (thanks all!)

http://www.jellybeangifts.co.uk (live, 4.0.18 ) Fancy Cats + custom colour mod
Reply With Quote
  #3  
Old 10-08-2006, 12:06 PM
  2coolbaby's Avatar 
2coolbaby 2coolbaby is offline
 

eXpert
  
Join Date: Sep 2004
Location: TN moving to FL
Posts: 265
 

Default Re: Tidy up registration

That is great! It got rid of forcing the customer to input their names twice. I always thought that unprofessional, but could never find an easy fix. Thanks!!!!
__________________
Mary Lee
-------------------
Dinner and a Murder Mystery Games
http://www.dinnerandamurder.com

x-cart version 4.7.5 / Mac OS 10.10.5 and Windows 8/10 sometimes - Ideal Responsive Template
Reply With Quote
  #4  
Old 10-12-2006, 09:16 PM
 
iDirectGrp.com iDirectGrp.com is offline
 

Newbie
  
Join Date: Oct 2006
Posts: 8
 

Default Re: Tidy up registration

Looked great, exactly what I've been looking for. Unfortunatly when customer goes to register it errors out with message stating required information missing?
__________________
Lew
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 02:45 AM.

   

 
X-Cart forums © 2001-2020