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

country before state

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 02-02-2005, 10:03 AM
 
cybrgman cybrgman is offline
 

Member
  
Join Date: Oct 2004
Posts: 10
 

Default country before state

Is it possible to move the country field above the state field when a customer is checking out ?

I've had quite a few emails from customers not figuring out they need to change the country first in order to enter their province.

I tried removing all the states which would be fine but we use flat rate shipping depending on state so removing all the states really isn't an option.

Any help would be great, thanks
__________________
X-Cart 4.0.13 :: X-RMA :: X-AOM :: MM 3.0 :: Easy Checkout :: Surcharge Mod
Reply With Quote
  #2  
Old 02-02-2005, 03:23 PM
 
balinor balinor is offline
 

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

Default

Sure, just edit the main/register_billing_address.tpl and main/register_shipping_address.tpl and move the fields around however you would like.
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #3  
Old 02-02-2005, 04:14 PM
 
cybrgman cybrgman is offline
 

Member
  
Join Date: Oct 2004
Posts: 10
 

Default

Quote:
Originally Posted by balinor
Sure, just edit the main/register_billing_address.tpl and main/register_shipping_address.tpl and move the fields around however you would like.

Thanks for your reply balinor,

I did that but it wouldn't work for me, seems that county, state and country all tie into one another somehow.

Could you be a bit more specific maybe I did something wrong?

I've done quite a bit of moding on this site and am usually able to resolve the issue but this one has me stumped.

BTW, I have Jon's easy checkout installed on this too but that shouldn't be an issue as the mod doesn't affect the registration form.
__________________
X-Cart 4.0.13 :: X-RMA :: X-AOM :: MM 3.0 :: Easy Checkout :: Surcharge Mod
Reply With Quote
  #4  
Old 02-02-2005, 04:56 PM
 
balinor balinor is offline
 

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

Default

There are a lot of {if} statements in there, so you have to be careful, but it is possible to move them. Did you try moving them and you got an error?
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #5  
Old 02-02-2005, 05:15 PM
 
cybrgman cybrgman is offline
 

Member
  
Join Date: Oct 2004
Posts: 10
 

Default

yes I did and I believe one of the {/if} is exactly what I screwed up, this is what I did.

Code:
{* $Id: register_billing_address.tpl,v 1.15.2.3 2004/10/26 13:08:43 max Exp $ *} {if $default_fields.b_state.avail eq 'Y' && $default_fields.b_country.avail eq 'Y' && $js_enabled eq 'Y' && $config.Adaptives.isJS eq 'Y' && $config.General.use_js_states eq 'Y' && $config.Adaptives.isDOM eq 'Y'}{include file="change_states_js.tpl"}{/if} {if $is_areas.B eq 'Y'} {if $hide_header eq ""} <TR> <TD height="20" colspan="3">{$lng.lbl_billing_address}<HR size="1" noshade></TD> </TR> {/if} {if $action eq "cart"} <INPUT type="hidden" name="action" value="cart"> <INPUT type="hidden" name="paymentid" value="{$paymentid}"> {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}{/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}{/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}{/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} {/if} {if $default_fields.b_address.avail eq 'Y'} <TR> <TD align="right">{$lng.lbl_address}</TD> <TD>{if $default_fields.b_address.required eq 'Y'}<FONT class="Star">*</FONT>{else}{/if}</TD> <TD nowrap> <INPUT type="text" id="b_address" name="b_address" size="32" maxlength="64" value="{$userinfo.b_address}"> {if $reg_error ne "" and $userinfo.b_address eq "" and $default_fields.b_address.required eq 'Y'}<FONT class="Star">&lt;&lt;</FONT>{/if} </TD> </TR> {/if} {if $default_fields.b_address_2.avail eq 'Y'} <TR> <TD align="right">{$lng.lbl_address_2}</TD> <TD>{if $default_fields.b_address_2.required eq 'Y'}<FONT class="Star">*</FONT>{else}{/if}</TD> <TD nowrap> <INPUT type="text" id="b_address_2" name="b_address_2" size="32" maxlength="64" value="{$userinfo.b_address_2}"> {if $reg_error ne "" and $userinfo.b_address_2 eq "" and $default_fields.b_address_2.required eq 'Y'}<FONT class="Star">&lt;&lt;</FONT>{/if} </TD> </TR> {/if} {if $default_fields.b_city.avail eq 'Y'} <TR> <TD align="right">{$lng.lbl_city}</TD> <TD>{if $default_fields.b_city.required eq 'Y'}<FONT class="Star">*</FONT>{else}{/if}</TD> <TD nowrap> <INPUT type="text" id="b_city" name="b_city" size="32" maxlength="64" value="{$userinfo.b_city}"> {if $reg_error ne "" and $userinfo.b_city eq "" and $default_fields.b_city.required eq 'Y'}<FONT class="Star">&lt;&lt;</FONT>{/if} </TD> </TR> {/if} {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} {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} {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_state.avail eq 'Y'} <TR> <TD align="right">{$lng.lbl_state}</TD> <TD>{if $default_fields.b_state.required eq 'Y'}<FONT class="Star">*</FONT>{else}{/if}</TD> <TD nowrap> {include file="main/states.tpl" states=$states name="b_state" default=$userinfo.b_state default_country=$userinfo.b_country} {if $error eq "b_statecode" and $default_fields.b_state.required eq 'Y'}<FONT class="Star">&lt;&lt;</FONT>{/if} </TD> </TR> {/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="32" maxlength="32" 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} {include file="main/register_additional_info.tpl" section="B"} {/if}

I just moved country right above state but I know thats wrong.

too many d*mn {if}'s and {/if}'s .... guess I'm getting old
__________________
X-Cart 4.0.13 :: X-RMA :: X-AOM :: MM 3.0 :: Easy Checkout :: Surcharge Mod
Reply With Quote
  #6  
Old 02-02-2005, 06:15 PM
 
balinor balinor is offline
 

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

Default

I think you need to take the second closing {/if} from the country grouping, and move it below the last {/if} in the state grouping.......
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #7  
Old 02-02-2005, 06:39 PM
 
mffowler mffowler is offline
 

X-Adept
  
Join Date: Mar 2003
Location: Melbourne, Australia
Posts: 811
 

Default

You have an else and an if statement ... you'll have to decide what you want to use.

- Mike
__________________
4.1.9
Reply With Quote
  #8  
Old 02-02-2005, 06:41 PM
 
cybrgman cybrgman is offline
 

Member
  
Join Date: Oct 2004
Posts: 10
 

Default

ok thanks balinor I'll give that a try in a little while once traffic slows down a bit.

I REALLY appreciate your help with this
__________________
X-Cart 4.0.13 :: X-RMA :: X-AOM :: MM 3.0 :: Easy Checkout :: Surcharge Mod
Reply With Quote
  #9  
Old 02-02-2005, 06:55 PM
 
cybrgman cybrgman is offline
 

Member
  
Join Date: Oct 2004
Posts: 10
 

Default

Quote:
Originally Posted by mffowler
You have an else and an if statement ... you'll have to decide what you want to use.

- Mike


sorry Mike just caught your post, can you explain further ?
__________________
X-Cart 4.0.13 :: X-RMA :: X-AOM :: MM 3.0 :: Easy Checkout :: Surcharge Mod
Reply With Quote
  #10  
Old 02-02-2005, 07:20 PM
 
cybrgman cybrgman is offline
 

Member
  
Join Date: Oct 2004
Posts: 10
 

Default

Ok I got it and it works

The only other thing I had to do was to also reverse the country and state fields in the register_states.tpl

Works like a charm

Thanks guys for your help .... excellent
__________________
X-Cart 4.0.13 :: X-RMA :: X-AOM :: MM 3.0 :: Easy Checkout :: Surcharge Mod
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 01:05 PM.

   

 
X-Cart forums © 2001-2020