Zen Cart Logo
Forums / Basic Configuration / Address Format not reflected after Admin/Country updated!

Address Format not reflected after Admin/Country updated!

Views: 1,441

Results 1 to 4 of 4
14 Mar 2021, 4:07 PM
#1
generikz avatar

generikz

New Zenner

Join Date:
Sep 2011
Location:
Tokyo
Posts:
26
Plugin Contributions:
0

Address Format not reflected after Admin/Country updated!

ZC 1.5.6c
Debian 10
PHP 5.6.40

Hello!

I tried to google/search the forum but didn't find anything compelling...

I found this page https://docs.zen-cart.com/user/localization/address_formats/ explaining the address formats, that's all good.
I also found where in the Admin Panel you can update the address_format ID in the Country definition.

France (country 73) default is set to 1 but it's more of a 5 really (ZIP code BEFORE the city).

So I updated France to use 5:

Name: France
Code ISO (2) : FR
Code ISO (3) : FRA
Address Format : 5

But going around the Admin orders, the address are still using the format 1 with City, Postcode.

Should I make modifications somewhere else as well?

Julien

14 Mar 2021, 5:03 PM
#2
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,081
Plugin Contributions:
56

Re: Address Format not reflected after Admin/Country updated!

generikz:

ZC 1.5.6c
Debian 10
PHP 5.6.40

Hello!

I tried to google/search the forum but didn't find anything compelling...

I found this page https://docs.zen-cart.com/user/localization/address_formats/ explaining the address formats, that's all good.
I also found where in the Admin Panel you can update the address_format ID in the Country definition.

France (country 73) default is set to 1 but it's more of a 5 really (ZIP code BEFORE the city).

So I updated France to use 5:

Name: France
Code ISO (2) : FR
Code ISO (3) : FRA
Address Format : 5

But going around the Admin orders, the address are still using the format 1 with City, Postcode.

Should I make modifications somewhere else as well?

Julien
The database's orders table includes a customers_address_format_id, billing_address_format_id and delivery_address_format_id. For the addresses to be displayed using the updated address-format, those fields will require update, too.

*Assuming *that the various _country fields (3 of them) are set to France when the associated address is in France, you could (after backing up your database!) run the following SQL statements to get the orders' address formats updated, too:

UPDATE orders SET customers_address_format_id = 5 WHERE customers_country = 'France';
UPDATE orders SET billing_address_format_id = 5 WHERE billing_country = 'France';
UPDATE orders SET delivery_address_format_id = 5 WHERE delivery_country = 'France';

Running the above statements in the admin's Tools :: Install SQL Patches will 'resolve' the DB_PREFIX. If you're using phpMyAdmin, you'll need to apply that prefix for each of the UPDATE statements, e.g. using **zen_orders **instead of orders.

15 Mar 2021, 3:17 AM
#3
generikz avatar

generikz

New Zenner

Join Date:
Sep 2011
Location:
Tokyo
Posts:
26
Plugin Contributions:
0

Re: Address Format not reflected after Admin/Country updated!

Thank you!

I will try on the DEV version first and confirm tonight.

Julien

15 Mar 2021, 8:28 AM
#4
generikz avatar

generikz

New Zenner

Join Date:
Sep 2011
Location:
Tokyo
Posts:
26
Plugin Contributions:
0

Re: Address Format not reflected after Admin/Country updated!

It works fine, and it shows up well in past orders!

Thanks again.

Julien