Magento: Italian provinces

  |   Read in English   |   Fonto

Ok, so you have Magento, and you're located in Italy. And you'd like your customers to select a province from a dropdown select box.

Unfortunately, Magento doesn't include Italian provinces in their default database: that's why I wrote a simple script to take care of that.

The script is in Python, and uses SQLAlchemy. You'll also need to download the list of provinces. You should run it like this:

$ ./ provinces

Be sure to run it only *once*, otherwise you'll get duplicated provinces in the database.

There is some commented code you should decomment if you want to test the script before actually touching the Magento database.

Also, you need to change the "user", "psw" and "dbname" parameters, and might need to change the "host" and "port" too.

Now, I need to understand how to require address input at the registration page. ARGH.

Comments powered by Disqus
Contents © 2013 David Paleino - Powered by Nikola