Jump to content

States Field - Customer Signup


Recommended Posts

I can't see any problem. Adding states to a country doesn't force you to use states instead of countries as shipping zones. Put each country you need to treat differently its own zone.


I've allocated zones to the country. How do I enable states in ALL the countries listed in my module, without having to do it 1 by 1 ?
Link to comment
Share on other sites

That's weird. So you don't have any states at all? PrestaShop comes with the US states by default. Did you delete them? You could re-run the states query to insert the default states, but if you want to add more states, your only choice is to add them one-by-one yourself.

INSERT INTO `ps_state` (`id_state`, `id_country`, `id_zone`, `name`, `iso_code`, `active`) VALUES
(1, 21, 2, 'Alabama', 'AL', 1),(2, 21, 2, 'Alaska', 'AK', 1),(3, 21, 2, 'Arizona', 'AZ', 1),(4, 21, 2, 'Arkansas', 'AR', 1),
(5, 21, 2, 'California', 'CA', 1),(6, 21, 2, 'Colorado', 'CO', 1),(7, 21, 2, 'Connecticut', 'CT', 1),(8, 21, 2, 'Delaware', 'DE', 1),
(9, 21, 2, 'Florida', 'FL', 1),(10, 21, 2, 'Georgia', 'GA', 1),(11, 21, 2, 'Hawaii', 'HI', 1),(12, 21, 2, 'Idaho', 'ID', 1),
(13, 21, 2, 'Illinois', 'IL', 1),(14, 21, 2, 'Indiana', 'IN', 1),(15, 21, 2, 'Iowa', 'IA', 1),(16, 21, 2, 'Kansas', 'KS', 1),
(17, 21, 2, 'Kentucky', 'KY', 1),(18, 21, 2, 'Louisiana', 'LA', 1),(19, 21, 2, 'Maine', 'ME', 1),(20, 21, 2, 'Maryland', 'MD', 1),
(21, 21, 2, 'Massachusetts', 'MA', 1),(22, 21, 2, 'Michigan', 'MI', 1),(23, 21, 2, 'Minnesota', 'MN', 1),
(24, 21, 2, 'Mississippi', 'MS', 1),(25, 21, 2, 'Missouri', 'MO', 1),(26, 21, 2, 'Montana', 'MT', 1),(27, 21, 2, 'Nebraska', 'NE', 1),
(28, 21, 2, 'Nevada', 'NV', 1),(29, 21, 2, 'New Hampshire', 'NH', 1),(30, 21, 2, 'New Jersey', 'NJ', 1),(31, 21, 2, 'New Mexico', 'NM', 1),
(32, 21, 2, 'New York', 'NY', 1),(33, 21, 2, 'North Carolina', 'NC', 1),(34, 21, 2, 'North Dakota', 'ND', 1),(35, 21, 2, 'Ohio', 'OH', 1),
(36, 21, 2, 'Oklahoma', 'OK', 1),(37, 21, 2, 'Oregon', 'OR', 1),(38, 21, 2, 'Pennsylvania', 'PA', 1),(39, 21, 2, 'Rhode Island', 'RI', 1),
(40, 21, 2, 'South Carolina', 'SC', 1),(41, 21, 2, 'South Dakota', 'SD', 1),(42, 21, 2, 'Tennessee', 'TN', 1),(43, 21, 2, 'Texas', 'TX', 1),
(44, 21, 2, 'Utah', 'UT', 1),(45, 21, 2, 'Vermont', 'VT', 1),(46, 21, 2, 'Virginia', 'VA', 1),(47, 21, 2, 'Washington', 'WA', 1),
(48, 21, 2, 'West Virginia', 'WV', 1),(49, 21, 2, 'Wisconsin', 'WI', 1),(50, 21, 2, 'Wyoming', 'WY', 1),(51, 21, 2, 'Puerto Rico', 'PR', 1),
(52, 21, 2, 'US Virgin Islands', 'VI', 1),(53, 21, 2, 'District of Columbia', 'DC', 1);

INSERT INTO `ps_state` (`id_country`, `id_zone`, `name`, `iso_code`, `tax_behavior`, `active`) VALUES
(145, 2, 'Aguascalientes', 'AGS', 0, 1),
(145, 2, 'Baja California', 'BCN', 0, 1),
(145, 2, 'Baja California Sur', 'BCS', 0, 1),
(145, 2, 'Campeche', 'CAM', 0, 1),
(145, 2, 'Chiapas', 'CHP', 0, 1),
(145, 2, 'Chihuahua', 'CHH', 0, 1),
(145, 2, 'Coahuila', 'COA', 0, 1),
(145, 2, 'Colima', 'COL', 0, 1),
(145, 2, 'Distrito Federal', 'DIF', 0, 1),
(145, 2, 'Durango', 'DUR', 0, 1),
(145, 2, 'Guanajuato', 'GUA', 0, 1),
(145, 2, 'Guerrero', 'GRO', 0, 1),
(145, 2, 'Hidalgo', 'HID', 0, 1),
(145, 2, 'Jalisco', 'JAL', 0, 1),
(145, 2, 'Estado de México', 'MEX', 0, 1),
(145, 2, 'Michoacán', 'MIC', 0, 1),
(145, 2, 'Morelos', 'MOR', 0, 1),
(145, 2, 'Nayarit', 'NAY', 0, 1),
(145, 2, 'Nuevo León', 'NLE', 0, 1),
(145, 2, 'Oaxaca', 'OAX', 0, 1),
(145, 2, 'Puebla', 'PUE', 0, 1),
(145, 2, 'Querétaro', 'QUE', 0, 1),
(145, 2, 'Quintana Roo', 'ROO', 0, 1),
(145, 2, 'San Luis Potosí', 'SLP', 0, 1),
(145, 2, 'Sinaloa', 'SIN', 0, 1),
(145, 2, 'Sonora', 'SON', 0, 1),
(145, 2, 'Tabasco', 'TAB', 0, 1),
(145, 2, 'Tamaulipas', 'TAM', 0, 1),
(145, 2, 'Tlaxcala', 'TLA', 0, 1),
(145, 2, 'Veracruz', 'VER', 0, 1),
(145, 2, 'Yucatán', 'YUC', 0, 1),
(145, 2, 'Zacatecas', 'ZAC', 0, 1);

INSERT INTO `ps_state` (`id_country`, `id_zone`, `name`, `iso_code`, `active`) VALUES
(4, 2, 'Ontario', 'ON', 1),
(4, 2, 'Quebec', 'QC', 1),
(4, 2, 'British Columbia', 'BC', 1),
(4, 2, 'Alberta', 'AB', 1),
(4, 2, 'Manitoba', 'MB', 1),
(4, 2, 'Saskatchewan', 'SK', 1),
(4, 2, 'Nova Scotia', 'NS', 1),
(4, 2, 'New Brunswick', 'NB', 1),
(4, 2, 'Newfoundland and Labrador', 'NL', 1),
(4, 2, 'Prince Edward Island', 'PE', 1),
(4, 2, 'Northwest Territories', 'NT', 1),
(4, 2, 'Yukon', 'YT', 1),
(4, 2, 'Nunavut', 'NU', 1);

INSERT INTO `ps_state` (`id_country`, `id_zone`, `name`, `iso_code`, `active`) VALUES
(58, 2, 'Acre', 'AC', 1),
(58, 2, 'Alagoas', 'AL', 1),
(58, 2, 'Amapá', 'AP', 1),
(58, 2, 'Amazonas', 'AM', 1),
(58, 2, 'Bahia', 'BA', 1),
(58, 2, 'Ceará', 'CE', 1),
(58, 2, 'Distrito Federal', 'DF', 1),
(58, 2, 'Espírito Santo', 'ES', 1),
(58, 2, 'Goiás', 'GO', 1),
(58, 2, 'Maranhão', 'MA', 1),
(58, 2, 'Mato Grosso', 'MT', 1),
(58, 2, 'Mato Grosso do Sul', 'MS', 1),
(58, 2, 'Minas Gerais', 'MG', 1),
(58, 2, 'Pará', 'PA', 1),
(58, 2, 'Paraíba', 'PB', 1),
(58, 2, 'Paraná', 'PR', 1),
(58, 2, 'Pernambuco', 'PE', 1),
(58, 2, 'Piauí', 'PI', 1),
(58, 2, 'Rio de Janeiro', 'RJ', 1),
(58, 2, 'Rio Grande do Norte', 'RN', 1),
(58, 2, 'Rio Grande do Sul', 'RS', 1),
(58, 2, 'Rondônia', 'RO', 1),
(58, 2, 'Roraima', 'RR', 1),
(58, 2, 'Santa Catarina', 'SC', 1),
(58, 2, 'São Paulo', 'SP', 1),
(58, 2, 'Sergipe', 'SE', 1),
(58, 2, 'Tocantins', 'TO', 1);



Change ps_ to your database prefix.

Link to comment
Share on other sites

Hello Rocky

I have little bit same problem. I have states, they are enabled. When customers come to register they have a field country and field states. Registration is OK .

But when they are registered yet, and want to change their address in form haven't field states. Can you help me?
I have to upgrade files from 1.3.1 to 1.3.2

Thanks

Link to comment
Share on other sites

There is a Javascript error on your page:

Line: 3
Char: 19842
Error: Expected ')'
Code: 0
URL: http://fitzona.com/e-shop/address.php?id_address=118



It seems one of your Javascript files is missing a closing parenthesis. It doesn't say which one though.

Link to comment
Share on other sites

  • 2 years later...

HI Rocky I am a Merchant using Prestashop 1.5.4.1 version for the first time. I have been reading the User Guide and inputting the information the order presented in the guide.

 

1 By accident I deleted several countries from the list [LOCALIZATION - COUNTRIES] How can i enter the original Prestashop country list? I need most of the countries deleted by accident.

2. Why can I see the STATE field in the address page the clients uses when setting up an account? How can I add the STATE field? The United States list is enable with green check mark [LOCALIZATION - STATES]

 

I am using Google Chrome and I am not a programmer.

 

Thank you.

Link to comment
Share on other sites

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...