Jump to content

How to change address format?


bos
 Share

Recommended Posts

The standard address format in CC6 seems to be conforming to UK standard. This gets a bit messed up when using Swedish addresses.

See the attached image. The correct Swedish address format using the values in the image should be:
 

Quote

 

TEST USER

Gatgatan 42

338 40 Göteborg

SWEDEN

 

 

Where can I change these settings?

2017-02-16_075326.png

Link to comment
Share on other sites

BSmither meant the skin template files and those can be changed to suit a different layout which is fine if all of your customers are from one country (or use one format as most of Europe except the UK does) but it would be much better if CubeCart could look at the country that the address is for and adjust the format to suit

Ian

Raised a github issue for this https://github.com/cubecart/v6/issues/1504

Link to comment
Share on other sites

Swedish addresses use three lines:

#1: Name + Surname

#2: Street address, house number, apartment number (etc)

#3: PostalCode    City

And that's it. We don't use states, counties or the like. That information is encoded in the postal code.

 

Link to comment
Share on other sites

338 40 Göteborg

The above is "Postal Code City"?

Are any customers of this store outside Sweden? (Well, I'm sure the rest of the world can suss the Swedish format.)

The address block for the Checkout page is the skin template content.checkout.confirm.php.

The customer's on-screen receipt is content.receipt.php, their printed receipt is print.receipt.php, the admin's packing slip is the admin's template orders.print.php.

 

 

Link to comment
Share on other sites

The format is "Postal code  (space)  City name". The code is exactly and always five numbers, grouped 3 and 2. I.e. "ABC DE", not "AB CDE" or something else.

There are a few customers outside Sweden, and to be honest; I don't care how the address format is from their point of view. My biggest concern so far is when I'm printing the address labels. Since they're all in UK-format, I've had to cut and paste and edit them all prior printing, and that's tedious work.

I will take a peek on the skin templates and see what I can poke around with. Thanks.

 

Link to comment
Share on other sites

  • 2 months later...
Guest demand

I change this after every update and it would be supernice to be able to choose an option to use scandinavian address style,

orders.index.php
153,154c153,154
<                {$OVERVIEW_SUMMARY.town_d}<br>
<                {$OVERVIEW_SUMMARY.state_d}, {$OVERVIEW_SUMMARY.postcode_d}<br>
---
>                {$OVERVIEW_SUMMARY.postcode_d} {$OVERVIEW_SUMMARY.town_d}<br>
>                {$OVERVIEW_SUMMARY.state_d}<br>
163,164c163,164
<                {$OVERVIEW_SUMMARY.town}<br>
<                {$OVERVIEW_SUMMARY.state}, {$OVERVIEW_SUMMARY.postcode}<br>
---
>                {$OVERVIEW_SUMMARY.postcode} {$OVERVIEW_SUMMARY.town}<br>
>                {$OVERVIEW_SUMMARY.state}<br>
249c245,247
<             <div><label for="sum_town">{$LANG.address.town}</label><span><input type="text" id="sum_town" name="customer[town]" value="{$SUMMARY.town}" class="textbox billing required"></span></div>
---
>             <div><label for="sum_postcode">{$LANG.address.postcode}</label><span><input type="text" id="sum_postcode" name="customer[postcode]" value="{$SUMMARY.postcode}" class="textbox billing"></span></div>
>             <div><label for="sum_town">{$LANG.address.town}</label><span><input type="text" id="sum_town" name="customer[town]" value="{$SUMMARY.town}" class="textbox billing required"></span></div>
>             <div><label for="sum_state">{$LANG.address.state}</label><span><input type="text" id="sum_state" name="customer[state]" value="{$SUMMARY.state}" class="textbox billing state-list required"></span></div>
258,259d256
<             <div><label for="sum_state">{$LANG.address.state}</label><span><input type="text" id="sum_state" name="customer[state]" value="{$SUMMARY.state}" class="textbox billing state-list required"></span></div>
<             <div><label for="sum_postcode">{$LANG.address.postcode}</label><span><input type="text" id="sum_postcode" name="customer[postcode]" value="{$SUMMARY.postcode}" class="textbox billing"></span></div>

290c286,288
<             <div><label for="d_sum_town">{$LANG.address.town}</label><span><input type="text" id="d_sum_town" name="customer[town_d]" value="{$SUMMARY.town_d}" class="textbox required"></span></div>
---
>             <div><label for="d_sum_postcode">{$LANG.address.postcode}</label><span><input type="text" id="d_sum_postcode" name="customer[postcode_d]" value="{$SUMMARY.postcode_d}" class="textbox required"></span></div>
>             <div><label for="d_sum_town">{$LANG.address.town}</label><span><input type="text" id="d_sum_town" name="customer[town_d]" value="{$SUMMARY.town_d}" class="textbox required"></span></div>
>             <div><label for="d_sum_state">{$LANG.address.state}</label><span><input type="text" id="d_sum_state" name="customer[state_d]" value="{$SUMMARY.state_d}" class="textbox state-list required"></span></div>
299,300d297
<             <div><label for="d_sum_state">{$LANG.address.state}</label><span><input type="text" id="d_sum_state" name="customer[state_d]" value="{$SUMMARY.state_d}" class="textbox state-list required"></span></div>
<             <div><label for="d_sum_postcode">{$LANG.address.postcode}</label><span><input type="text" id="d_sum_postcode" name="customer[postcode_d]" value="{$SUMMARY.postcode_d}" class="textbox required"></span></div>
orders.print.php
30,34c30,34
< 	  		{$order.town_d}<br>
< 	  		{$order.state_d}, {$order.postcode_d}<br>
< 	  		{$order.country_d}
< 		  </div>
< 		  <div class="sender">{$LANG.address.return_address}<br>{$STORE.address}, {$STORE.county}, {$STORE.postcode} {$STORE.country}</div>
---
> 	  		{$order.postcode_d} {$order.town_d}<br>
> 	  		{$order.state_d}<br>
> 	  		{$order.country_d}
> 		  </div>
> 		  <div class="sender">{$LANG.address.return_address}<br>{$STORE.address}, {$STORE.postcode}, {$STORE.country}</div>

99c99
< 		<p>{$STORE.address}, {$STORE.county}, {$STORE.postcode} {$STORE.country}</p>
---
> 		<p>{$STORE.address}, {$STORE.postcode}, {$STORE.country}</p>
107c107
< 		  <div class="sender">{$LANG.address.return_address}<br>{$STORE.address}, {$STORE.county}, {$STORE.postcode} {$STORE.country}</div>
---
> 		  <div class="sender">{$LANG.address.return_address}<br>{$STORE.address}, {$STORE.postcode}, {$STORE.country}</div>
customers.index.php
169c169,171
< 	  <div><label for="address_town">{$LANG.address.town}</label><span><input type="text" name="address[town]" id="address_town" value="{$ADDRESS.town}" class="textbox"></span></div>
---
> 	  <div><label for="address_postcode">{$LANG.address.postcode}</label><span><input type="text" name="address[postcode]" id="address_postcode" value="{$ADDRESS.postcode}" class="textbox uppercase"></span></div>
> 	  <div><label for="address_town">{$LANG.address.town}</label><span><input type="text" name="address[town]" id="address_town" value="{$ADDRESS.town}" class="textbox"></span></div>
> 	  <div><label for="state-list">{$LANG.address.state}</label><span><input type="text" name="address[state]" id="state-list" value="{$ADDRESS.state}" class="textbox"></span></div>
175,176d177
< 	  <div><label for="state-list">{$LANG.address.state}</label><span><input type="text" name="address[state]" id="state-list" value="{$ADDRESS.state}" class="textbox"></span></div>
< 	  <div><label for="address_postcode">{$LANG.address.postcode}</label><span><input type="text" name="address[postcode]" id="address_postcode" value="{$ADDRESS.postcode}" class="textbox uppercase"></span></div>

196c196
< 		  {$address.line1}, {if !empty($address.line2)}{$address.line2}, {/if}{$address.town}, {$address.state_name}, {$address.postcode}, {$address.country_name}
---
> 		  {$address.line1}, {if !empty($address.line2)}{$address.line2}, {/if}{$address.postcode}, {$address.town}, {$address.state_name}, {$address.country_name}

262c256,258
< 	  <div><label for="edit_town">{$LANG.address.town}</label><span><input type="text" name="address[town][]" id="edit_town" class="textbox add"> *</span></div>
---
> 	  <div><label for="edit_postcode">{$LANG.address.postcode}</label><span><input type="text" name="address[postcode][]" id="edit_postcode" class="textbox add uppercase"> *</span></div>
> 	  <div><label for="edit_town">{$LANG.address.town}</label><span><input type="text" name="address[town][]" id="edit_town" class="textbox add"> *</span></div>
> 	  <div><label for="edit_state">{$LANG.address.state}</label><span><input type="text" name="address[state][]" id="edit_state" class="textbox add state-list"> *</span></div>
271,272d267
< 	  <div><label for="edit_state">{$LANG.address.state}</label><span><input type="text" name="address[state][]" id="edit_state" class="textbox add state-list"> *</span></div>
< 	  <div><label for="edit_postcode">{$LANG.address.postcode}</label><span><input type="text" name="address[postcode][]" id="edit_postcode" class="textbox add uppercase"> *</span></div>

Dont know if this is my last notes.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...