X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Add fields to Shipping Address (https://forum.x-cart.com/showthread.php?t=18752)

mmoskva 12-18-2005 08:45 PM

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>


balinor 12-19-2005 04:35 AM

Please post your EXACT version in your signature. (i.e. 4.0.17). Can't help you without it.

mmoskva 12-19-2005 06:37 AM

my version is 4.0.16

mmoskva 12-20-2005 09:58 AM

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)

balinor 12-20-2005 10:04 AM

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

{if $default_fields.firstname.avail eq 'Y'} {/if}

mmoskva 12-21-2005 05:00 AM

I tried removing the if tags like you mentioned but once I did that I recieved a smarty error.

balinor 12-21-2005 05:22 AM

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.

mmoskva 12-21-2005 06:21 AM

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

balinor 12-21-2005 06:26 AM

Don't put anything in the variants box unless you want it to be a drop-down list.

mmoskva 12-22-2005 06:52 AM

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...

mmoskva 12-23-2005 06:46 AM

I added the FIrst Name and Last Name fields to the Shipping Address you you mentioned bailor and it worked.

The problem is that by default the s_firstname and s_lastname fields are filled out by the values of the lastname and the firstname fields. And i need the s_firstname & s_lastname to use their own fields. Can someone tell me how to change those in my register_shipping_address.tpl file.

Code:

code:

{if $default_fields.firstname.avail eq 'Y'}
<TR>
<TD align="left"><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 align="right">
<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="left"><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 align="right">
<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}


JWait 01-09-2006 05:17 AM

Quote:

Originally Posted by mmoskva
I added the FIrst Name and Last Name fields to the Shipping Address you you mentioned bailor and it worked.

The problem is that by default the s_firstname and s_lastname fields are filled out by the values of the lastname and the firstname fields.


Do you have some sort of 'easy checkout' mod installed? The default the s_firstname and s_lastname fields are filled out by the customer unless the template has been modified.

geckoday 01-09-2006 06:34 AM

Take a look at this mod to get a seperate billing name. I have applied it to 4.0.14 and it works great.

http://forum.x-cart.com/viewtopic.php?t=10479


All times are GMT -8. The time now is 03:04 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.