hi All
can somebody point me to the right direction:
in orders.php there ist $address->format
How can i change this format?
i need
Firstname name
street
zipcode city
(instead of:
firstnam name
street
city, zipcode)
thanks
How to change "format" of the address in orders.php?
- ReneH4
- Contributor
- Posts: 145
- Joined: Mon Oct 26, 2020 12:00 pm
- Phoenix Version:
- Has thanked: 13 times
- Been thanked: 17 times
Re: how to change "format" of the adress in orders.php?
In Admin go to Locationa and taxes > Countries
Fot every country you can set the address format. I think you need 5.
Fot every country you can set the address format. I think you need 5.
-
loop
- Contributor
- Posts: 253
- Joined: Thu Mar 25, 2021 12:26 pm
- Phoenix Version:
- Has thanked: 7 times
- Been thanked: 3 times
Re: how to change "format" of the adress in orders.php?
hi! i tried both:
to change in the admin in the country and also in the function itself (in orders.php)
echo $address->format($order->customer, 1, '', '<br>'); like echo $address->format($order->customer, 5, '', '<br>');
but it does not change the format of the adress in orders.php (or is it only on new orders? and not on already saved orders?)
to change in the admin in the country and also in the function itself (in orders.php)
echo $address->format($order->customer, 1, '', '<br>'); like echo $address->format($order->customer, 5, '', '<br>');
but it does not change the format of the adress in orders.php (or is it only on new orders? and not on already saved orders?)
- ReneH4
- Contributor
- Posts: 145
- Joined: Mon Oct 26, 2020 12:00 pm
- Phoenix Version:
- Has thanked: 13 times
- Been thanked: 17 times
Re: how to change "format" of the adress in orders.php?
Loop, this is for new orders only. The format is used to store the address with the order into the database, so it will not change once the order is placed.
Last edited by ReneH4 on Thu Jul 14, 2022 6:26 am, edited 1 time in total.
-
ecartz
- Core Team
- Posts: 3084
- Joined: Tue Nov 05, 2019 6:02 pm
- Phoenix Version:
- Has thanked: 4 times
- Been thanked: 208 times
Re: how to change "format" of the address in orders.php?
cd_traditional_address->format does not take a format_id argument. The second argument is the Boolean for whether to use HTML or plain text. Instead tryloop wrote: ↑Thu Jul 14, 2022 6:06 amCode: Select all
echo $address->format($order->customer, 1, '', '<br>'); echo $address->format($order->customer, 5, '', '<br>');
Code: Select all
echo $address->format(array_replace($order->customer, ['format_id' => 5]), 1, '', '<br>');-
loop
- Contributor
- Posts: 253
- Joined: Thu Mar 25, 2021 12:26 pm
- Phoenix Version:
- Has thanked: 7 times
- Been thanked: 3 times
Re: How to change "format" of the address in orders.php?
you are the best ecartz! thank you!
is the "old format_id" somewhere stored in the database so i could change this in the sql to 5?
is the "old format_id" somewhere stored in the database so i could change this in the sql to 5?