Jump to content

SOLVED: New Customer Registration: Swap sequence of fields?


sumsel

Recommended Posts

Hi,

currently in Prestashop 1.7.4.4 when a new customer registers, in the address fields there is

- State

- Country

 

in this sequence.

However for a number of countries, no state is required.

When such a country is selected from the second field, the first one will disappear.

But the first one (state) is above country. So a simple minded customer will try to fill this out. All the while, entry of that field is often not required at all! After filling in the country (just below), state will disappear, the entry was for nothing! Also, the dropdown contains all states of the country determined by IP geolocation. If that matches, it may be no problem. If it doesn't match, the User may despair! Depending how much the user knows about the workings of websites. As I sell food, I may have quite a few customers which can barely fill out an easy form, not a cumbersome one.

Wouldn't it be much easier to have the state field hidden, and only make it appear when required, after the country is selected?

Or at least have State BELOW country?

Any way to achieve this?

I found a lot of topics about custom fields, but that's way beyond what I try to do, hope someone can prod me towards an instruction to change this sequence of fields.

Thanks!

 

Edited by sumsel
solved. Posting solution below. (see edit history)
Link to comment
Share on other sites

The sequence of fields is determined in the country localisation.

The database table is this:

(Prefix_)address_format

For each country, the sequence of fields is put down there.

There are 244 countries registered, hence 244 entries that should potentially be modified.

I now realize that the problem as such doesn't really exist. I just happened to browse from the odd country which had the weirdest setup (in Indonesia localisation was made so that state would come before country, and that is rather the exception). Changed the sequence for test purposes and the change was immediately reflected in the form.

So normally, as far as geolocation works, the customer will see the sequence of fields that is set in this table, and which will usually make sense for the customer.

Table (prefix_)address_format contains only the country ID, so if you want to modify a specific country, you need to know the ID of that country (number between 1-244). To find out the number, browse table (prefix_)country where you can browse by country ID or phone prefix. Note the ID number, and go to that ID number in table (prefix_)address_format.

Problem didn't actually exist. Marked as solved.

Edited by sumsel (see edit history)
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...