I have a slight problem with the states. I'm required to apply a tax to anyone from my state, but since the state is dependent on the customer's input, there's a small problem. Customer may mis-spell state and thus not be charged(I already have to have 3 different regions for the same state - the initials, the word capitalized, the word, not capitalized).
Can you either create a dropdown menu or maybe have a checkbox where I can ask "Do you live in...?" so that they can be charged the appropiate tax.

Comments

nehalmehta’s picture

You can do this by dropdown box. Look at this video http://www.youtube.com/watch?v=XrL89KRFB3Y where I have shown dependent dropdown for countries, states and cities. You can have it for your cities. You just need to use CAT + AS module and u r done with it.

brmassa’s picture

Version: 5.x-3.x-dev » 5.x-3.0
Assigned: Unassigned » brmassa

Emanuel,

look the store_location.inc (inside store directory). there are instructions to customize your address state field, using a dropdown. Unfortunately, it is very buggy. i provide a patch on http://drupal.org/node/135477.

A curious thing is for United States, its already working, without any mods or patchs.

regards,

massa

swirt’s picture

I managed to make certain states an option using the following patch

1) make this adjustment to store.inc Starting at line 362

'#default_value' => $address->city,
'#size' => 32,
'#maxlength' => 32,
);
- $form['state'] = array(
- '#type' => 'textfield',
- '#title' => t('State/Province'),
- '#default_value' => $address->state,
- '#size' => 32,
- '#maxlength' => 32,
- );
+ $form['state'] = array(
+ '#type' => 'select',
+ '#title' => t('State/Province'),
+ '#default_value' => ($address->state ? $address->state : variable_get('ec_state', '')),
+ '#options' => store_build_states(),
+ );

2) Optional: Edit the list of states and or countries if needed in store_location.inc to remove any states you can not ship to (I just commented out the states I didn't need / can't ship to)

brmassa’s picture

Version: 5.x-3.0 » 5.x-4.x-dev
Status: Active » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)