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

Address Fields

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 06-08-2004, 10:57 PM
 
BenderNZ BenderNZ is offline
 

Newbie
  
Join Date: Jun 2004
Posts: 2
 

Default Address Fields

Hi,

I've searched but can't find anyone else with the same issue.

When customers go to register on our store, they have to fill in the following details:

Address *
City *
State * Pull Down Menu
Country * Pull Down Menu
Post Code *

I've edited Zip Code to read Post Code.

In New Zealand we use Suburbs on the postal addresses, and it's not practical to add every single suburb in New Zealand to the menu.

Is there some way I can make the State field free format, as opposed to a pull down menu?

Thanks in advance
Reply With Quote
  #2  
Old 06-09-2004, 02:17 AM
  shan's Avatar 
shan shan is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Birmingham, UK
Posts: 6,163
 

Default

just delete all the states that you have and it will become a text box
__________________
Looking for a reliable X-cart host ?
You wont go wrong with either of these.

EWD Hosting
Hands On Hosting
Reply With Quote
  #3  
Old 06-15-2004, 12:17 PM
 
thewho thewho is offline
 

Advanced Member
  
Join Date: Feb 2004
Posts: 31
 

Default

i am trying to disable the state and the country from showing up in the
Registration form, so i wrote the fallowing if

Code:
{if $store_language ne "FL"} <tr valign=middle> <td align=right>{$lng.lbl_state}</td> <td>{if $states ne ""}<font class=Star>*</font>{/if}</td> <td nowrap> {include file="main/states.tpl" states=$states name="b_state" default=$userinfo.b_state default_country=$userinfo.b_country} </td> </tr> <tr valign=middle> <td align=right>{$lng.lbl_country}</td> <td><font class=Star>*</font></td> <td nowrap> <select name=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> </td> </tr> {/if}

but when i try to register the display is ok(no state and no country)
but the submit give me an error that i have mistakes in my form.
any idea ?


and another thing,
why "register.php" won't recognize the variable "$store_language"
__________________
X-Cart PRO v4.1.1
--PHP [need to update]
--MySQL [need to update]
Web server Unix
Reply With Quote
  #4  
Old 06-16-2004, 08:46 PM
 
FX FX is offline
 

Member
  
Join Date: May 2004
Location: US
Posts: 12
 

Default

in include/register.php find and comment out this code:
(!empty($states) && empty($b_state)) || empty($b_country) ||

Original
$fillerror = (empty($uname) || !empty($error) || empty($passwd1) || empty($passwd2) || ($passwd1 != $passwd2) || empty($firstname) || empty($lastname) || empty($b_address) || empty($b_city) || (!empty($states) && empty($b_state)) || empty($b_country) || empty($b_zipcode) || empty($phone) || empty($email));

Modified
$fillerror = (empty($uname) || !empty($error) || empty($passwd1) || empty($passwd2) || ($passwd1 != $passwd2) || empty($firstname) || empty($lastname) || empty($b_address) || empty($b_city) ||/* (!empty($states) && empty($b_state)) || empty($b_country) || */empty($b_zipcode) || empty($phone) || empty($email));

This code validates if you've selected or not state and/or country in your register form. So if you disable anything in register.tpl file you also have to disable validation checks in register.php because if you disable the state and the country from showing up in the Registration form, for register.php it means you didn't select anything and it won't let you complete registration process.

try this out, it should work
Reply With Quote
  #5  
Old 06-20-2004, 03:12 AM
 
BenderNZ BenderNZ is offline
 

Newbie
  
Join Date: Jun 2004
Posts: 2
 

Default

Quote:
Originally Posted by shan
just delete all the states that you have and it will become a text box

Hrm, I tried that but then got to the point of shipping and my customers would then be able to select all shipping options, and the prices vary based on whether they're in a given city, we don't want users picking the cheapest option, paying then getting grumpy when we tell them that they can't do that.

Is there an easier way to get two address fields? I tried a tutorial I found in another forum here but it seems too patchy.
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 11:55 AM.

   

 
X-Cart forums © 2001-2020