Closed (fixed)
Project:
e-Commerce
Version:
5.x-4.x-dev
Component:
address
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
7 Apr 2007 at 11:55 UTC
Updated:
11 Aug 2007 at 08:21 UTC
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
Comment #1
nehalmehta commentedYou 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.
Comment #2
brmassa commentedEmanuel,
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
Comment #3
swirtI 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)
Comment #4
brmassa commentedfixed on commit http://drupal.org/cvs?commit=75005
Comment #5
(not verified) commented