Entering an address requires me to enter a value for "state" although in the address form that field is not marked mandatory. In my country (Belgium), the state or province is not part of the address, so my customers should be able to skip this field. However, this returns an error:

Please enter a state/province/region.

Then every customer is required to select the value "Outside US". The result of this is that a value of "1" is displayed as the state/province, which makes the final address is incorrect:

Firstname Lastname
Street n°
MyCity, 1 ZIPCODE
Belgium

Comments

sime’s picture

Fixed, see http://drupal.org/cvs?commit=44339

I didn't want to make the us drop-down not required, but the problem is in the validate function - if both state and province are empty you couldn't tell whether it's because of a missing value in the state select.

So I've just allowed a little override. Not for 5.0, as I'll sort this out properly. To override, add this to the bottom of settings.php:

 $conf = array(
   'store_ignore_state' => TRUE,
 );
sime’s picture

Status: Active » Fixed

marking fixed
let me know if a problem still

drupaceous’s picture

Great, works fine now. Thanks for taking the trouble to fix this.

Anonymous’s picture

Status: Fixed » Closed (fixed)
druvision’s picture

Version: 4.7.x-1.x-dev » 5.x-3.x-dev
Status: Closed (fixed) » Active

sime wrote:

Not for 5.0, as I'll sort this out properly.

It's 5.x and the issue is still not sorted out properly.
The settings.php bypass works, but it's only a bybass.

I am from Israel and we have the same problem - no states.

Here is a spec (design) to close this issue:

  1. Add a new selection list to the store settings, named 'Country Field Behavior', with three possible selections: A) Hidden, B) Read Only, C) Required. 'Hidden' and 'Read Only' will populate the country field with the default store country. It will be only possible to select a country when the 'Country' field to become required. 'Hidden' will cause the country field not to be displayed at all.
  2. Add a new selection list to the store settings, named 'State Field Behavior', with the same three selections.
  3. Add a new selection list to the store settings, named 'Zip field Behaviou', with two selections: required and optional

Also - consider using CCK for the addresses.

Thanks alot for the great work done.

Amnon
-
Professional: Drupal Search | Drupal Israel | Web Hosting Strategies
Personal: Hitech Dolphin: Regain Simple Joy :)

druvision’s picture

Title: Address field form "state:" should be optional, but is required » Address fields - optional, required or hidden

Same for the phone field:

4. Add a new selection list to the store settings, named 'Phone Field Behavior', with the same three selections.

It seems it's a general issue - allow to define which address fields are to be optional, required or hidden. Hence I am changing the title of the issue.

brmassa’s picture

Version: 5.x-3.x-dev » 5.x-4.x-dev

Guys,

1* It wont be fixed on Ecommerce 3. the problem is very deep.
2* It will be fixed on Ecommerce 4. In fact, address module will be rewritten.
3* A new EC module called ec_location will provide a link with location module and will be able to be used instead address if you want.

regards,

massa

PEpe’s picture

It would be nice define own address fields... Something like creating node type with CKK...

gordon’s picture

Status: Active » Postponed

Because of the FormAPI this cannot really be fixed in Drupal 5, Once we get to Drupal 6 maybe the formapi will let us fix it.

brmassa’s picture

Title: Address fields - optional, required or hidden » Address fields - optional, required or hidden
Status: Postponed » Closed (fixed)