[Skip to main content](#vessel-content)

#   Confirmation email address field order

##

- **[suliak](/forum/user/27626-suliak "View suliak's Profile")**
- [![suliak's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/27626-suliak "View suliak's Profile") Topic Author
- [ Offline](/forum/user/27626-suliak)

Less More

- Posts: 15
- Thank you received: 0
-
-

13 years 1 week ago [\#128485](#128485) by [suliak](/forum/user/27626-suliak "View suliak's Profile")  *[Confirmation email address field order](/forum/4-how-to/862915-confirmation-email-address-field-order#128485 "Hi,  I would like to change the order of the address fields in the email confirmation. Right now on checkout they are  Address city state postcode/zip  But in the email they are different (specifically the zip is not after state, it is before city). I would like to change that if possible, but in the system-&gt;email file I see this:  if(!empty($data-&gt;cart-&gt;billing&#95;address) &amp;&amp; !empty($data-&gt;order&#95;addresses&#95;fields)){ $billing = $template; foreach($data-&gt;order&#95;addresses&#95;fields as $field){ $fieldname = $field-&gt;field&#95;namekey; $address =&amp; $data-&gt;order&#95;addresses&#91;$data-&gt;cart-&gt;billing&#95;address-&gt;address&#95;id&#93;; if(!empty($address-&gt;$fieldname)) $billing=str&#95;replace('{'.$fieldname.'}',$fieldsClass-&gt;show($field,$address-&gt;$fieldname),$billing); }  And I am not sure where I would go to edit the order from here.  Thanks")* was created by *[suliak](/forum/user/27626-suliak "View suliak's Profile")*

Hi,

I would like to change the order of the address fields in the email confirmation. Right now on checkout they are

Address
city
state
postcode/zip

But in the email they are different (specifically the zip is not after state, it is before city). I would like to change that if possible, but in the system-&gt;email file I see this:

*if(!empty($data-&gt;cart-&gt;billing\_address) &amp;&amp; !empty($data-&gt;order\_addresses\_fields)){
$billing = $template;
foreach($data-&gt;order\_addresses\_fields as $field){
$fieldname = $field-&gt;field\_namekey;
$address =&amp; $data-&gt;order\_addresses\[$data-&gt;cart-&gt;billing\_address-&gt;address\_id\];
if(!empty($address-&gt;$fieldname)) $billing=str\_replace('{'.$fieldname.'}',$fieldsClass-&gt;show($field,$address-&gt;$fieldname),$billing);
}*

And I am not sure where I would go to edit the order from here.

Thanks

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzg2MjkxNS1jb25maXJtYXRpb24tZW1haWwtYWRkcmVzcy1maWVsZC1vcmRlcj90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")**
- [![Mohamed Thelji's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar6861.png)](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")
- [ Offline](/forum/user/6861-mohamed-thelji)

Less More

- Posts: 12953
- Thank you received: 1778
-
-
-

13 years 1 week ago [\#128501](#128501) by [Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")  Replied by *[Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")* on topic *[Confirmation email address field order](/forum/4-how-to/862915-confirmation-email-address-field-order#128501 "Hi,  I would like to change the order of the address fields in the email confirmation. Right now on checkout they are  Address city state postcode/zip  But in the email they are different (specifically the zip is not after state, it is before city). I would like to change that if possible, but in the system-&gt;email file I see this:  if(!empty($data-&gt;cart-&gt;billing&#95;address) &amp;&amp; !empty($data-&gt;order&#95;addresses&#95;fields)){ $billing = $template; foreach($data-&gt;order&#95;addresses&#95;fields as $field){ $fieldname = $field-&gt;field&#95;namekey; $address =&amp; $data-&gt;order&#95;addresses&#91;$data-&gt;cart-&gt;billing&#95;address-&gt;address&#95;id&#93;; if(!empty($address-&gt;$fieldname)) $billing=str&#95;replace('{'.$fieldname.'}',$fieldsClass-&gt;show($field,$address-&gt;$fieldname),$billing); }  And I am not sure where I would go to edit the order from here.  Thanks")*

Hi,

I think that the solution will probably be to edit change the field ordering of the "Address_template" file of the "Order" view of your Back-end template through "*Hikashop-&gt;Display-&gt;Views*".

The following user(s) said Thank You: [suliak](/forum/user/27626-suliak "View suliak's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzg2MjkxNS1jb25maXJtYXRpb24tZW1haWwtYWRkcmVzcy1maWVsZC1vcmRlcj90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[suliak](/forum/user/27626-suliak "View suliak's Profile")**
- [![suliak's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/27626-suliak "View suliak's Profile") Topic Author
- [ Offline](/forum/user/27626-suliak)

Less More

- Posts: 15
- Thank you received: 0
-
-

13 years 1 week ago [\#128512](#128512) by [suliak](/forum/user/27626-suliak "View suliak's Profile")  Replied by *[suliak](/forum/user/27626-suliak "View suliak's Profile")* on topic *[Confirmation email address field order](/forum/4-how-to/862915-confirmation-email-address-field-order#128512 "Hi,  I would like to change the order of the address fields in the email confirmation. Right now on checkout they are  Address city state postcode/zip  But in the email they are different (specifically the zip is not after state, it is before city). I would like to change that if possible, but in the system-&gt;email file I see this:  if(!empty($data-&gt;cart-&gt;billing&#95;address) &amp;&amp; !empty($data-&gt;order&#95;addresses&#95;fields)){ $billing = $template; foreach($data-&gt;order&#95;addresses&#95;fields as $field){ $fieldname = $field-&gt;field&#95;namekey; $address =&amp; $data-&gt;order&#95;addresses&#91;$data-&gt;cart-&gt;billing&#95;address-&gt;address&#95;id&#93;; if(!empty($address-&gt;$fieldname)) $billing=str&#95;replace('{'.$fieldname.'}',$fieldsClass-&gt;show($field,$address-&gt;$fieldname),$billing); }  And I am not sure where I would go to edit the order from here.  Thanks")*

Thank you, that seems to work perfectly. Is it possible to change the {address_state} to the 2 letter zone designation for the state?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzg2MjkxNS1jb25maXJtYXRpb24tZW1haWwtYWRkcmVzcy1maWVsZC1vcmRlcj90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26394
- Thank you received: 4078
-
- [](http://obsi.dev)
-

13 years 1 week ago [\#128623](#128623) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Confirmation email address field order](/forum/4-how-to/862915-confirmation-email-address-field-order#128623 "Hi,  I would like to change the order of the address fields in the email confirmation. Right now on checkout they are  Address city state postcode/zip  But in the email they are different (specifically the zip is not after state, it is before city). I would like to change that if possible, but in the system-&gt;email file I see this:  if(!empty($data-&gt;cart-&gt;billing&#95;address) &amp;&amp; !empty($data-&gt;order&#95;addresses&#95;fields)){ $billing = $template; foreach($data-&gt;order&#95;addresses&#95;fields as $field){ $fieldname = $field-&gt;field&#95;namekey; $address =&amp; $data-&gt;order&#95;addresses&#91;$data-&gt;cart-&gt;billing&#95;address-&gt;address&#95;id&#93;; if(!empty($address-&gt;$fieldname)) $billing=str&#95;replace('{'.$fieldname.'}',$fieldsClass-&gt;show($field,$address-&gt;$fieldname),$billing); }  And I am not sure where I would go to edit the order from here.  Thanks")*

Hi,

It is possible but it requires some development and PHP skills to right edit the views which display the address.
The "address_template" gives a template of what display and how.
But the "address_state" is displayed using the state custom field, which just show the state name (and not the state 2 letters code).
So, if you want to display the state in 2 letters, you will have to change how the address_template is used in the views and add a new kind of "tag" to display this 2 letters code.

*$fieldsClass-&gt;show($field, $address-&gt;$fieldname)* allow to display the custom field content, but it will display the state name for the state custom field.
You can access to the raw value *$address-&gt;$fieldname* which contains the zone_namekey, do a request in the database to load information about the state and display the 2 letter code instead.

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

The following user(s) said Thank You: [suliak](/forum/user/27626-suliak "View suliak's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzg2MjkxNS1jb25maXJtYXRpb24tZW1haWwtYWRkcmVzcy1maWVsZC1vcmRlcj90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[suliak](/forum/user/27626-suliak "View suliak's Profile")**
- [![suliak's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/27626-suliak "View suliak's Profile") Topic Author
- [ Offline](/forum/user/27626-suliak)

Less More

- Posts: 15
- Thank you received: 0
-
-

13 years 1 week ago [\#128632](#128632) by [suliak](/forum/user/27626-suliak "View suliak's Profile")  Replied by *[suliak](/forum/user/27626-suliak "View suliak's Profile")* on topic *[Confirmation email address field order](/forum/4-how-to/862915-confirmation-email-address-field-order#128632 "Hi,  I would like to change the order of the address fields in the email confirmation. Right now on checkout they are  Address city state postcode/zip  But in the email they are different (specifically the zip is not after state, it is before city). I would like to change that if possible, but in the system-&gt;email file I see this:  if(!empty($data-&gt;cart-&gt;billing&#95;address) &amp;&amp; !empty($data-&gt;order&#95;addresses&#95;fields)){ $billing = $template; foreach($data-&gt;order&#95;addresses&#95;fields as $field){ $fieldname = $field-&gt;field&#95;namekey; $address =&amp; $data-&gt;order&#95;addresses&#91;$data-&gt;cart-&gt;billing&#95;address-&gt;address&#95;id&#93;; if(!empty($address-&gt;$fieldname)) $billing=str&#95;replace('{'.$fieldname.'}',$fieldsClass-&gt;show($field,$address-&gt;$fieldname),$billing); }  And I am not sure where I would go to edit the order from here.  Thanks")*

Hi,

Thanks, that makes sense to me up until the last part (the HOW of accessing ($address-&gt;$fieldname). My Objective php is pretty weak, but I will look into it and if I get too stuck I might ask for more help.

Thanks again for the help so far. You guys have all been great.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzg2MjkxNS1jb25maXJtYXRpb24tZW1haWwtYWRkcmVzcy1maWVsZC1vcmRlcj90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop- Install &amp; Update- Product &amp; Category Display- Content Creation- Sales and Orders- - Orders management- - Reports &amp; Statistics- Customers- Checkout- Payment Methods- Shipping Methods- Import &amp; Export (CSV, XLS…)- Specific Features- - Affilation- - Taxes- - Wishlist- - Vote- - Carousel &amp; Slider- - Mass Actions- - Filters &amp; Search- - Discount &amp; Coupon- - Feature Request- Integrations- Showcase- General Talk about HikaShop- Development- - HikaShop 3.0 Beta- Translation- Commercial Jobs HikaShop Components- HikaMarket- - Market: Feature requests- - Market: How to?- - Market: Bug Report- HikaSerial- - General talk about HikaSerial- - Serial: Bug Report- - Serial: How to?- - Support en Français de HikaSerial (French Support)- - HikaSubscription- HikaAuction- - Auction: Feature requests- - Auction: How to?- - Auction: Bug report Hikashop around the world- Support en Français (French Support)- Russian- - FAQ. Курс выживания с Hikashop. Частые вопросы и о- - Расширения Hikashop- - Наши сайты на Hikashop- 日本語版サポート(Japanese Support)- Thai- German Archives- Bug Report- How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.115 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)

[](#top)
