guys,
i needed to have a list of all Brazilian states. so i created a store_custom.inc including " $available_states['br'] = array(...", as stated on store_location.inc.
there are 2 bugs:
1* the address form misbehave oftem: sometimes it loads $available_states['us'], but sometimes it loads my custom $available_states['br']. the behaviour is just not reliable.
2* the address.js file only changes if the contry is "us", so doesnt matter what contry you customize. Worst: when ecommerce module updates, this file will be set to normal again!
i may urgely suggest:
1* to create some database alternative instead using a file like store_custom.inc. so other modules can manipulate them. a web interface to manage (import/export/change) this data. i can help on this.
2* start to include many new states on main store_location.inc for next releases.
best regards
massa
PS: brazilian states are:
$available_states['br'] = array(
'AC' => 'Acre',
'AL' => 'Alagoas',
'AP' => 'Amapá',
'AM' => 'Amazonas',
'BA' => 'Bahia',
'CE' => 'Ceará',
'DF' => 'Distrito Federal',
'ES' => 'Espírito Santo',
'GO' => 'Goiás',
'MA' => 'Maranhão',
'MT' => 'Mato Grosso',
'MS' => 'Mato Grosso do Sul',
'MG' => 'Minas Gerais',
'PA' => 'Pará',
'PB' => 'Paraíba',
'PR' => 'Paraná',
'PE' => 'Pernambuco',
'PI' => 'Piauí',
'RJ' => 'Rio de Janeiro',
'RN' => 'Rio Grande do Norte',
'RS' => 'Rio Grande do Sul',
'RO' => 'Rondônia',
'RR' => 'Roraima',
'SC' => 'Santa Catarina',
'SP' => 'São Paulo',
'SE' => 'Sergipe',
'TO' => 'Tocantins',
);
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | module2.patch | 534 bytes | brmassa |
| #2 | js2.patch | 1.57 KB | brmassa |
| #1 | address.txt | 1.1 KB | brmassa |
Comments
Comment #1
brmassa commentedguys,
this patch corrects the complete misbehave of javascript on address. the current code only works for US.
bugs fixed:
* you now can update your state/province
* dropdown menu available for all predefined countries.
it doesnt fix:
* a better way to deal with custom data instead editing store_custom.inc
regards,
massa
PS: the zip file, containing the patch to address.module and address.js were renamed to TXT.
Comment #2
brmassa commentedcorrection: the patchs are inverted.
Comment #3
brmassa commentedcorrection: the patchs are inverted.
Comment #4
simeThanks for the patch, I will test it.
You *can* edit store_custom.inc. It won't be deleted, because when you copy new ecommerce over old ecommerce. New ecommerce will never have this file, so the current file will remain.
You other ideas:
Store in database -
We won't do this in ecommerce. We don't want to manage large country lists like this. Eventually location.module will be the optional alternative.
Add more to store_location.inc -
no, this will consume too much resources when it is included. This might be ok if it was an admin function only, but this will get called on every address page.
Comment #5
brmassa commentedSimon,
thanks for your response.
best regards,
massa
Comment #6
simeOk, I understand. I might have another option for you.
I do want to know: can these clients edit settings.php OK?
Comment #7
brmassa commentedSimon,
he he... generally, no. The common thing is: the reseller configure everything once: settings, cron and modules instalation (now thru installation profiles). Who uses these kind of services dont know much. They are newbies and want a "just works" products.
sometimes, its only a single Drupal installation for many clients. not file access at all.
a third group is formed by linux users using distro packages. Im working on porting Drupal 5.1 to Ubuntu. No access to files besides root. The current problem is about modules and theming installation, so im building a module just for this.
Despite all these reason and situations, i really believe that Drupal can (or even should) be simple to use. That why i proposed a web interface for address module configuration. my opinion only.
im gonna open a forum topic to get from users all customized states data. might be helpfull.
regards,
massa
PS: i think that its not clear that the patch corrects a important bug: you simply cannot update your state/provice once you created. its because a bug on Javascript. It also allows users to really use the customized states.
Comment #8
brmassa commentedFixed on ec4
Comment #9
simeHi brmassa
I haven't looked at this in a while. What fix did you use?
Comment #10
(not verified) commented