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)
-   -   Reorder fields in main/register_billing_address.tpl (https://forum.x-cart.com/showthread.php?t=23822)

carpeperdiem 08-03-2006 07:30 PM

Reorder fields in main/register_billing_address.tpl
 
I want to re-order the fields (as displayed) in main/register_billing_address.tpl

I tried "simply" moving things around - but there is some method to the madness... and it appears that the country is tied to state and postal code...

The default order for this tpl is:
What I want is for the customer input to look like this:
note - the country is the last field...

I tried swapping these paragraphs...
Code:

{if $default_fields.b_country.avail eq 'Y'}
<TR>
<TD align="right">{$lng.lbl_country}</TD>
<TD>{if $default_fields.b_country.required eq 'Y'}<FONT class="Star">*</FONT>{else}{/if}</TD>
<TD nowrap>
<SELECT name="b_country" id="b_country" onChange="check_zip_code()">
{section name=country_idx loop=$countries}
<OPTION value="{$countries[country_idx].country_code}"{if $userinfo.b_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.b_country eq "" and $default_fields.b_country.required eq 'Y'}<FONT class="Star">&lt;&lt;</FONT>{/if}
</TD>
</TR>
{/if}
{/if}

{if $default_fields.b_zipcode.avail eq 'Y'}
<TR>
<TD align="right">{$lng.lbl_zip_code}</TD>
<TD>{if $default_fields.b_zipcode.required eq 'Y'}<FONT class="Star">*</FONT>{else}{/if}</TD>
<TD nowrap>
<INPUT type="text" id="b_zipcode" name="b_zipcode" size="10" maxlength="10" value="{$userinfo.b_zipcode}" onChange="check_zip_code()" >
{if $reg_error ne "" and $userinfo.b_zipcode eq "" and $default_fields.b_zipcode.required eq 'Y'}<FONT class="Star">&lt;&lt;</FONT>{/if}
</TD>
</TR>
{/if}


Zip code disappeared :(

Anyone know how to do this?

balinor 08-04-2006 02:29 AM

You sure you grabbed all the if statements when you swapped them?

carpeperdiem 08-04-2006 03:32 AM

Quote:

Originally Posted by balinor
You sure you grabbed all the if statements when you swapped them?


Yes.

Here's the code with line numbers:
If I grab lines 114-126, and insert it after line 139, I get a 2nd country field.

If I grab lines 131-139 and simply insert it before line 114, the zip/postal code field disappears.

Hmm...

I just looked at about 20 x-cart stores, it appears nobody has changed this! I can live with this, but it's not "customary" for my country... postal code typically comes before "country". Now, if country were the first entry, I would understand... ok, let me try that...

Ok -- I moved the country paragraph to the top (which I like) - but there is STILL the extra country field...

I think this is related to the "county" code:
Code:

{if $default_fields.b_state.avail eq 'Y' && $default_fields.b_country.avail eq 'Y' && $js_enabled eq 'Y' && $config.General.use_js_states eq 'Y'}
{include file="main/register_states.tpl" state_name="b_state" country_name="b_country" country=$userinfo.b_country state=$userinfo.b_state|default:$config.General.default_state full_state=$userinfo.b_statename county_name="b_county" default_county=$userinfo.b_countyname default_countyid=$userinfo.b_county form_name="registerform" zipcode_name="b_zipcode"}
{else}
{if $default_fields.b_county.avail eq 'Y' and $config.General.use_counties eq "Y"}
<TR>
<TD align="right">{$lng.lbl_county}</TD>
<TD>{if $default_fields.b_county.required eq 'Y'}<FONT class="Star">*</FONT>{else}{/if}</TD>
<TD nowrap>
{include file="main/counties.tpl" counties=$counties name="b_county" default=$userinfo.b_county country_name="b_country"}
{if ($reg_error ne "" and $userinfo.b_county eq "" and $default_fields.b_county.required eq 'Y') or $error eq "b_county"}<FONT class="Star">&lt;&lt;</FONT>{/if}
</TD>
</TR>
{/if}


I can't figure out what's going on in there... I am not using counties - but if I comment this paragraph out, there's an error...

Can someone try to swap these paragraphs and are your results the same?

Thanks,

Jeremy

PS -- putting the country field on top doesn't work -- since the STATES and country are linked ina way -- I only have 2 countries enabled right now (US & Canada) and when Canada is selected, there is a pull down list of provinces. When US is selected, there is a pulldown list of states.

SO -- the design of this input box really should have country before anything, since states (and even counties) are all dependent on the country input. The flaw in the interface design is the customer has to jump around... instead of a linear flow, next, next, next, etc... the customer has to jump down, input country, then they get more options... bad design, IMO.

How are others getting around this? (well, I haven't seen anyone get around it yet -- in all of the xcart "live" demo stores).


All times are GMT -8. The time now is 11:52 PM.

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