Jump to content

How to make country as a required field?


Recommended Posts

I registered a new name as a member in my site www.beli-online.net. Things work fine when I filled up the fields until I noticed that without filling in the "state field" I also managed to register my name in the system successfully.
This is my big problem for me as my carrier fee is based on the state.
What make me more confuse is, there is a red asterisk at the state field showing that the field is required to be filled. If not we cannot proceed to the next process. But things do not happen that way. How to make a country as a required field?

Link to comment
Share on other sites

  • 1 month later...
I registered a new name as a member in my site www.beli-online.net. Things work fine when I filled up the fields until I noticed that without filling in the "state field" I also managed to register my name in the system successfully.
This is my big problem for me as my carrier fee is based on the state.
What make me more confuse is, there is a red asterisk at the state field showing that the field is required to be filled. If not we cannot proceed to the next process. But things do not happen that way. How to make a country as a required field?


Prestashop by default allows you to register without entering a state. If you want the state field or any other like Home Phone" to be required you need to edit the class file "Address.php" look for the following line:

protected    $fieldsRequired = array('id_country',



Make it look like this:

protected    $fieldsRequired = array('id_country', 'alias', 'lastname', 'firstname', 'address1', 'postcode', 'city', 'id_state');

Link to comment
Share on other sites

  • 1 year later...
  • 1 year 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...