Page 1 of 1
Address format question
Posted: Thu Jun 04, 2009 12:56 am
by npn2531
On the checkout/confirm page. The address appears as:
First
Last
Street
City, State, Zip
That is, with 'First' on top of 'Last'
How would you change this to:
First Last
Street
City, State, Zip
ie with First and Last on the same line?
Thanks!
Re: Address format question
Posted: Thu Jun 04, 2009 6:00 am
by phpuk
Which version are you using as it is all on one line for me.
Re: Address format question
Posted: Thu Jun 04, 2009 8:51 am
by npn2531
version 1.2.8, however I have been modifying things a bit. If I knew where or how one would put them on one line or on two, I could go back and see what happened.
Everything else on Opencart seems to be well thought out and how you would expect things to be, so I suspect I have changed a margin or added a space or something 'somewhere'.
Re: Address format question
Posted: Thu Jun 04, 2009 9:06 am
by Daniel
Put this in the country address format:
{firstname} {lastname}
{address_1}
{city}, {State}, {zip}
Re: Address format question
Posted: Thu Jun 04, 2009 9:10 am
by phpuk
I would start with looking at catalog/controller/account/address.php.
Re: Address format question
Posted: Thu Jun 04, 2009 9:13 am
by phpuk
Daniel must have posted whilst I was looking.
Where is the country address format stored?
Re: Address format question
Posted: Thu Jun 04, 2009 9:34 am
by Qphoria
Admin menu
Configuration->localization->country->edit country
Re: Address format question
Posted: Thu Jun 04, 2009 9:46 am
by phpuk
Thanks Qphoria,
I had found it not long after posting
Broke one of my rules look first then post ah well.
Re: Address format question
Posted: Thu Jun 04, 2009 6:03 pm
by gavin m
Daniel wrote:Put this in the country address format:
{firstname} {lastname}
{address_1}
{city}, {State}, {zip}
Is there a list of address formats for other countries anywhere?
Re: Address format question
Posted: Fri Jun 05, 2009 4:37 am
by npn2531
Thank you for your responses:
I still have firstname on top of lastname in checkout/shipping
I have gone through your suggestions and have this:
format in Configuration->localization->country->edit country seems to be as it should be:
{firstname} {lastname}
{company}
{address_1}
{address_2}
{city}, {zone} {postcode}
{country}
and in catalog/controller/account/address.php. I have this, which seems ok
foreach ($results as $result) {
if ($result['address_format']) {
$format = $result['address_format'];
} else {
$format = '{firstname} {lastname}' . "\n" . '{company}' . "\n" . '{address_1}' . "\n" . '{address_2}' . "\n" . '{city} {postcode}' . "\n" . '{zone}' . "\n" . '{country}';
}
Perhaps I need to check and see where ['address_format'] above is defined? I looked in system/library/customer.php and there is this about line 49, 'address_format' => $result['address_format'], but that doesn't seem to me to be quite the place.
Any more suggestions?, or perhaps a checklist I should work through?
Thanks!
Re: Address format question
Posted: Fri Jun 05, 2009 4:41 am
by Qphoria
it only applies to new orders from now on. Existing orders aren't changed
Re: Address format question
Posted: Fri Jun 05, 2009 6:33 am
by npn2531
actually, I have entered a new test account and the first name still appears over the last name, and it does so everywhere the address_format appears. For example, in the account/address page
Re: Address format question
Posted: Fri Jun 05, 2009 12:31 pm
by npn2531
I have installed a fresh new opencart, and with no modifications, the first name always appears over the last name, regardless of where the 'address_format' appears. Can this be changed?
Re: Address format question
Posted: Mon Apr 12, 2010 10:19 am
by jfn99
Anyone knows how to add the customers phone number to address?
{firstname} {lastname}
{company}
{address_1}
{address_2}
{city}, {zone} {postcode}
{telephone}
didn't work...
Re: Address format question
Posted: Mon Apr 12, 2010 10:46 am
by Qphoria
telephone is stored at the customer level, not the address level, so that's not really supported
Telephone should already be listed on its own line in all places that the address formatting is used
Re: Address format question
Posted: Mon Apr 12, 2010 11:51 pm
by jfn99
when I open an Invoice from the ADMIN - orders - Print Invoice
it doesn't show the customer phone number.
what file should I edit, what line should I change?
I tried
admin/controller/sale/order.php
$format = '{firstname} {lastname}' . "\n" . '{company}' . "\n" . '{address_1}' . "\n" . '{address_2}' . "\n" . '{city} {postcode}' . "\n" . '{zone}' . "\n" . "<br><b>Phone:</b> " . '{telephone}' . "\n" . "<b>Customer Email:</b> " . '{email}';
it didn't change anything
thanks a lot for your attention...
Re: Address format question
Posted: Wed Dec 29, 2010 2:35 pm
by oclollo
I have change the adress format to this:
{förnamn} {efternamn}
{adress_1}
{adress_2}
{postnummer} {ort}
Land = {land}
but also, this is what I get in front end: see attached. What is the reason?
Re: Address format question
Posted: Wed Dec 29, 2010 3:09 pm
by oclollo
Also, where do I change the format of this - see attached - the address listing when changing/adding address?
Re: Address format question
Posted: Thu Dec 30, 2010 3:03 am
by Qphoria
oclollo wrote:I have change the adress format to this:
{förnamn} {efternamn}
{adress_1}
{adress_2}
{postnummer} {ort}
Land = {land}
but also, this is what I get in front end: see attached. What is the reason?
Those tags are code values and not meant to be translated. You must use the actual supported english tags:
{firstname} {lastname} etc
The format doesn't apply to the address select page.. only the invoice
Re: Address format question
Posted: Thu Dec 30, 2010 1:40 pm
by oclollo
Thanks. How about changing the order of address in address select page - where is it done? I want "name, address, postcode, city, country" (for Sweden)