Jump to content

Cities according to the state selected.


eCasper

Recommended Posts

Recently I was able to add a new tab called "Cities" into shipping section via BO. and it just works fine with following additional files and table.

AdminCities.php
Cities.php

table : ps_city: id_city, id_state, name, postcode, active.

My requirement is as follows.

1. If a state is selected and its id_state found in ps_city table, I would like to show a dropdown list with all available cities belong to the selected state instead of inputbox against "City" field in address.tpl. but by default "City" field should be a inputbox since only one county contains states and cities.

2. Then if the user selected a City from the dropdown, corresponding postal code should be automatically updated with ps_city.postcode value. and "Postal Code" inputbox should be readonly. by default this also should be readonly = .F.

3. Either country or state has been changed, "Postal Code" and "City" filed should be reset to their default status.

Can anyone help me with this? I'm not sure whether this is a big modification or not but any help will be really appreciated.

Thank you!

Link to comment
Share on other sites

  • 4 weeks later...
  • 1 month later...

Dear eCasper,

I am looking out for functionality to restrict the shipping to a only one city.
For this, I am seeking for necessary code changes.

But I am lost as to where I should make the changes. Could you please guide me where I should make changes?

From your topic, I could make out that you had created/modified some php files and db tables.

Your guidance will be deeply appreciated.

thanks in advance

Link to comment
Share on other sites

  • 8 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...