Jump to content

State requirement is not working on Create Account, works in Update Address.


Recommended Posts

Went to make an account for the store as a customer and I picked USA which you need to pick a state of course, but you can pick " - " basically the dash and it will let you continue. But if you go to update your address you can not pick the " - " wondering how I can make create account the same as update your address. Cause currently I have a ton of customers that have no state and very few that do, due to that the states thing on when creating an account.

Link to comment
Share on other sites

You are right. I never noticed that before. This is definitely a bug. You should report it to the bug tracker.

Until it is fixed, here is a quick patch I did. Add the following code at line 76 of authentication.php (the line before $errors):

if (!$country = new Country($_POST['id_country']) OR !Validate::isLoadedObject($country))
   die(Tools::displayError());
if (intval($country->contains_states) AND !intval($_POST['id_state']))
   $errors[] = Tools::displayError('this country require a state selection');

Link to comment
Share on other sites

Well thanks to dumb customers not picking a state I suppose.

That works great, thanks couldn't find anything in the forum. The default way how it works is to pick the default state and country when creating and account so not sure if thats Prestashops main goal.

Link to comment
Share on other sites

  • 3 weeks later...

I do see a great deal due to that when you do pick a country that has states, the states magically appear under the country and many just skip it all together. Though they put in their zip code and address. So I could figure out the state easily, but hey the client didnt want to figure it out all the time so, this fixed work thanks again.

Link to comment
Share on other sites

  • 3 weeks later...

Hi,

I am currently using and testing PrestaShop version 1.2 Alpha. This feature seemingly has been accomodated in that last version.

For example, if you choose your country that contains States that you already defined before, then only that States will be displayed in States selection. Otherwise, if you choose a country which has no States, then the States selection does not show up at all on that form. I really love this feature as I have been waiting for this since I used the version 1.1 for the first time.

The only thing that should be known by PrestaShop Developer Team is: I have just found that when customer edit his/her own address, the selected States always give result: "-" selection, even all States that belongs to his/her country exist in the selection list. It should be the States will be automatically selected to the State that belong to the address' customer properly.

I hope this will be fixed again in the 1.2 Stable version.

Can't wait the the stable version.

Bravo and thanks so much to PrestaShop Developer Team for great work. :-)

Link to comment
Share on other sites

  • 2 weeks later...

thanks good work ;)

You are right. I never noticed that before. This is definitely a bug. You should report it to the bug tracker.

Until it is fixed, here is a quick patch I did. Add the following code at line 76 of authentication.php (the line before $errors):

if (!$country = new Country($_POST['id_country']) OR !Validate::isLoadedObject($country))
   die(Tools::displayError());
if (intval($country->contains_states) AND !intval($_POST['id_state']))
   $errors[] = Tools::displayError('this country require a state selection');

Link to comment
Share on other sites

  • 8 months later...
  • 4 months later...


The only thing that should be known by PrestaShop Developer Team is: I have just found that when customer edit his/her own address, the selected States always give result: "-" selection, even all States that belongs to his/her country exist in the selection list. It should be the States will be automatically selected to the State that belong to the address' customer properly.


Is this issue has been solved?
I'm using the latest version of 1.3.1.1 but still having this problem...
Can somebody help?
Link to comment
Share on other sites

I'm pretty sure this was fixed in PrestaShop v1.3.1. Are you using a theme from an earlier version of PrestaShop? If you are, you are missing out on many bug fixes made to the theme. Try changing your theme to the default PrestaShop v1.3.1 theme and see whether the problem still exists.

Link to comment
Share on other sites

  • 9 months later...

hi rocky im so confused this is making me upset i have an older them on my website www.kingofthehookah.com but have the same problem when i try to add my address to see if shipping is set correctly it wont bring up my state or any state at all how can i use the same them im using latest version of prestashop and want to fix this bug thanks for all your help also please explain step by step what to do because its hard for me being a newbe thanks again what to do

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