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

Add fields to Shipping Address

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 12-18-2005, 08:45 PM
 
mmoskva mmoskva is offline
 

eXpert
  
Join Date: Aug 2005
Location: Pennsylvania
Posts: 306
 

Default Add fields to Shipping Address

I need to add a: "First Name & Last Name" text field to my shipping address at my register page.

I looked in my general setting> profile options but in my Shipping Address, I see that the first name and last name fields are not displayed.

At the bottom of the page their is an Additional fields area that allows me to add text areas but I am alittle confused on what you type in; what is the Variants for Select box type?

Also, when I look at my "register_shipping_address.tpl" file i noticed that their is a: (code located below)
{$lng.lbl_first_name}:
{$lng.lbl_last_name}:

So it looks to my like the first name and last name fields are pre built-in as default but I my admin setting I cannot find nod to select it to display.

Currently I have the following fields display in my register:

Address1
Address2
City
State
Zip

I need:

First Name
Last Name
Address1
Address2
City
State
Zip


Code:
{if $default_fields.firstname.avail eq 'Y'} <TR> <TD align="right"><font class="SubHeader2">{$lng.lbl_first_name}:</font></TD> <TD>{if $default_fields.firstname.required eq 'Y' && $is_s_fields}<FONT class="Star"></FONT>{else}{/if}</TD> <TD nowrap> <INPUT type="text" name="s_firstname" size="32" maxlength="32" value="{$userinfo.s_firstname}" class="SubHeader4">[img]{$ImagesDir}/spacer.gif[/img] {if $reg_error ne "" and $userinfo.s_firstname eq "" && $default_fields.firstname.required eq 'Y' && $is_s_fields}<FONT class="Star">&lt;&lt;</FONT>{/if} </TD> </TR> {/if} {if $default_fields.lastname.avail eq 'Y'} <TR> <TD align="right"><font class="SubHeader2">{$lng.lbl_last_name}:</font></TD> <TD>{if $default_fields.lastname.required eq 'Y' && $is_s_fields}<FONT class="Star"></FONT>{else}{/if}</TD> <TD nowrap> <INPUT type="text" name="s_lastname" size="32" maxlength="32" value="{$userinfo.s_lastname}" class="SubHeader4">[img]{$ImagesDir}/spacer.gif[/img] {if $reg_error ne "" and $userinfo.s_lastname eq "" && $default_fields.lastname.required eq 'Y' && $is_s_fields}<FONT class="Star">&lt;&lt;</FONT>{/if} </TD> </TR> {/if} {/if} {if $default_fields.s_address.avail eq 'Y'} <TR> <TD align="left"><font class="SubHeader2">{$lng.lbl_address}:</font></TD> <TD>{if $default_fields.s_address.required eq 'Y'}<FONT class="Star"></FONT>{else}{/if}</TD> <TD nowrap align="right"> <INPUT type="text" id="s_address" name="s_address" size="32" maxlength="64" value="{$userinfo.s_address}" class="SubHeader4">[img]{$ImagesDir}/spacer.gif[/img] {if $reg_error ne "" and $userinfo.s_address eq "" and $default_fields.s_address.required eq 'Y'}<FONT class="Star">&lt;&lt;</FONT>{/if} </TD> </TR> {/if} {if $default_fields.s_address_2.avail eq 'Y'} <TR> <TD align="left"><font class="SubHeader2">{$lng.lbl_address_2}:</font></TD> <TD>{if $default_fields.s_address_2.required eq 'Y'}<FONT class="Star"></FONT>{else}{/if}</TD> <TD nowrap align="right"> <INPUT type="text" id="s_address_2" name="s_address_2" size="32" maxlength="64" value="{$userinfo.s_address_2}" class="SubHeader4">[img]{$ImagesDir}/spacer.gif[/img] {if $reg_error ne "" and $userinfo.s_address_2 eq "" and $default_fields.s_address_2.required eq 'Y'}<FONT class="Star">&lt;&lt;</FONT>{/if} </TD> </TR> {/if} {if $default_fields.s_city.avail eq 'Y'} <TR> <TD align="left"><font class="SubHeader2">{$lng.lbl_city}:</font></TD> <TD>{if $default_fields.s_city.required eq 'Y'}<FONT class="Star"></FONT>{else}{/if}</TD> <TD nowrap align="right"> <INPUT type="text" id="s_city" name="s_city" size="32" maxlength="64" value="{$userinfo.s_city}" class="SubHeader4">[img]{$ImagesDir}/spacer.gif[/img] {if $reg_error ne "" and $userinfo.s_city eq "" and $default_fields.s_city.required eq 'Y'}<FONT class="Star">&lt;&lt;</FONT>{/if} </TD> </TR> {/if} {if $default_fields.s_state.avail eq 'Y' && $default_fields.s_country.avail eq 'Y' && $js_enabled eq 'Y' && $config.General.use_js_states eq 'Y'} {include file="main/register_states.tpl" state_name="s_state" country_name="s_country" country=$userinfo.s_country state=$userinfo.s_state|default:$config.General.default_state full_state=$userinfo.s_statename county_name="s_county" default_county=$userinfo.s_countyname default_countyid=$userinfo.s_county form_name="registerform" zipcode_name="s_zipcode"} {else} {if $default_fields.s_county.avail eq 'Y' and $config.General.use_counties eq "Y"} <TR> <TD align="left"><font class="SubHeader2">{$lng.lbl_county}:</font></TD> <TD>{if $default_fields.s_county.required eq 'Y'}<FONT class="Star"></FONT>{else}{/if}</TD> <TD nowrap align="right"> {include file="main/counties.tpl" counties=$counties name="s_county" default=$userinfo.s_county country_name="s_country"} {if ($reg_error ne "" and $userinfo.s_county eq "" and $default_fields.s_county.required eq 'Y') or $error eq "s_county"}<FONT class="Star">&lt;&lt;</FONT>{/if} </TD> </TR> {/if} {if $default_fields.s_state.avail eq 'Y'} <TR> <TD align="left"><font class="SubHeader2">{$lng.lbl_state}:</font></TD> <TD>{if $default_fields.s_state.required eq 'Y'}<FONT class="Star"></FONT>{else}{/if}</TD> <TD nowrap align="right"> {include file="main/states.tpl" states=$states name="s_state" default=$userinfo.s_state default_country=$userinfo.s_country country_name="s_country"} {if ($reg_error ne "" and $userinfo.s_state eq "" and $default_fields.s_state.required eq 'Y') or $error eq "s_statecode"}<FONT class="Star">&lt;&lt;</FONT>{/if} </TD> </TR> {/if} {if $default_fields.s_country.avail eq 'Y'} <TR> <TD align="left"><font class="SubHeader2">{$lng.lbl_country}:</font></TD> <TD>{if $default_fields.s_country.required eq 'Y'}<FONT class="Star"></FONT>{else}{/if}</TD> <TD nowrap align="right"> <SELECT name="s_country" id="s_country" size="1" onChange="check_zip_code()">[img]{$ImagesDir}/spacer.gif[/img] {section name=country_idx loop=$countries} <OPTION value="{$countries[country_idx].country_code}"{if $userinfo.s_country eq $countries[country_idx].country_code} selected{elseif $countries[country_idx].country_code eq $config.General.default_country and $userinfo.b_country eq ""} selected{/if}>{$countries[country_idx].country}</OPTION> {/section} </SELECT> {if $reg_error ne "" and $userinfo.s_country eq "" and $default_fields.s_country.required eq 'Y'}<FONT class="Star">&lt;&lt;</FONT>{/if} </TD> </TR> {/if} {/if} {if $default_fields.s_zipcode.avail eq 'Y'} <TR> <TD align="left"><font class="SubHeader2">{$lng.lbl_zip_code}:</font></TD> <TD>{if $default_fields.s_zipcode.required eq 'Y'}<FONT class="Star"></FONT>{else}{/if}</TD> <TD nowrap align="right"> <INPUT type="text" id="s_zipcode" name="s_zipcode" size="32" maxlength="32" value="{$userinfo.s_zipcode}" onChange="check_zip_code()" class="SubHeader4">[img]{$ImagesDir}/spacer.gif[/img] {if $reg_error ne "" and $userinfo.s_zipcode eq "" and $default_fields.s_zipcode.required eq 'Y'}<FONT class="Star">&lt;&lt;</FONT>{/if} </TD> </TR> {/if} {if $active_modules.UPS_OnLine_Tools and $av_enabled eq "Y"} <TR> <TD colspan="3"> {include file="modules/UPS_OnLine_Tools/ups_av_notice.tpl" postoffice=1} {include file="modules/UPS_OnLine_Tools/ups_av_notice.tpl"} </TD> </TR> {/if} {include file="main/register_additional_info.tpl" section="S"} {/if} </table> </div> </td> </tr> </TABLE>
__________________
x-cart 4.0.16v
linux server
Reply With Quote
  #2  
Old 12-19-2005, 04:35 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default

Please post your EXACT version in your signature. (i.e. 4.0.17). Can't help you without it.
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #3  
Old 12-19-2005, 06:37 AM
 
mmoskva mmoskva is offline
 

eXpert
  
Join Date: Aug 2005
Location: Pennsylvania
Posts: 306
 

Default

my version is 4.0.16
__________________
x-cart 4.0.16v
linux server
Reply With Quote
  #4  
Old 12-20-2005, 09:58 AM
 
mmoskva mmoskva is offline
 

eXpert
  
Join Date: Aug 2005
Location: Pennsylvania
Posts: 306
 

Default

Can someone tell me how to add a (First Name & Last Name) fields to my shipping address.

Also, in my register_shipping_address.tpl file I noticed that their is a code
that does call the a shipping addres (first name & last name).

Does someone know how to do this?



(4.0.16v)
__________________
x-cart 4.0.16v
linux server
Reply With Quote
  #5  
Old 12-20-2005, 10:04 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default

Just remove the surrounding {if} statement on the first and last name fields:

{if $default_fields.firstname.avail eq 'Y'} {/if}
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #6  
Old 12-21-2005, 05:00 AM
 
mmoskva mmoskva is offline
 

eXpert
  
Join Date: Aug 2005
Location: Pennsylvania
Posts: 306
 

Default

I tried removing the if tags like you mentioned but once I did that I recieved a smarty error.
__________________
x-cart 4.0.16v
linux server
Reply With Quote
  #7  
Old 12-21-2005, 05:22 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default

You need to make sure to remove the correct tags so you don't break an {if} statement. Both the opening and closing tags need to be removed or commented out.
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #8  
Old 12-21-2005, 06:21 AM
 
mmoskva mmoskva is offline
 

eXpert
  
Join Date: Aug 2005
Location: Pennsylvania
Posts: 306
 

Default

I commented out and removed all the if tags and when i refreshed the page, it loaded but the first name and last name fields dont show.

In my admin > user profile options

It looks like I can add fields, what do you type in the varients for select box?

Ex. Variants for Select box type (use ';' symbol as variants delimiter): a
__________________
x-cart 4.0.16v
linux server
Reply With Quote
  #9  
Old 12-21-2005, 06:26 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default

Don't put anything in the variants box unless you want it to be a drop-down list.
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #10  
Old 12-22-2005, 06:52 AM
 
mmoskva mmoskva is offline
 

eXpert
  
Join Date: Aug 2005
Location: Pennsylvania
Posts: 306
 

Default

Once you add a field to the shipping address "First Name" and "Last Name", does someone know what the language variable name is so I can call those fields in my invoice and etc?

Ex:
$lng.txt...
$lng.lbl...
__________________
x-cart 4.0.16v
linux server
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



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 09:32 AM.

   

 
X-Cart forums © 2001-2020