News:

Support the VirtueMart project and become a member

Main Menu

Drop down list for City field

Started by Sergio1808, July 10, 2012, 23:52:52 PM

Previous topic - Next topic

Sergio1808

Hi everyone!

I need help to create a drop down list in the City field for the Shipment Address of the client. This list have to be conected with the state table, as the state is conected with the country, i.e.

Country -> Colombia
                  |--> State -> Antioquia --->City-> Medellín / Rionegro / Envigado / ETC.
                                      Amazonas --->City-> Leticia / Puerto Naiño / ETC.
                                      Bogotá D.C. ---> City-> Bogotá
                                      ...

In my database I created a new table "virtuemart_city". I have to do this because the cities have a specific code, i.e. Medellín code = 05001 and it's necessary for the carrier.

So... I have 2 questions

1. How I conect the "virtuemart_city" table with the "virtuemart_states"?

In the attachments you can see the "virtuemart_city" Index... what I need to change?
'city_dane_code" is the column for the City Code "05001".

2. How can I create a drop down list in the frontend for the Cities? Where is located the php file to modify it?

Thanks for the help :D


[attachment cleanup by admin]

Xethron

I need to do the same. Did you manage to get this right by any chance?

We have a webservice with a list of Towns (State / Province / Region) and Suburbs (City).

I saw I can simply populate the virtuemart_states table with all the Towns, however, I need a way to fetch the Suburb (City) for every Town.

This is for a Shipping Module for a South African Courier Service.

Thanks :)

thelogh