Confirmation email address field order

  • Posts: 15
  • Thank you received: 0
11 years 2 weeks ago #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->email file I see this:

if(!empty($data->cart->billing_address) && !empty($data->order_addresses_fields)){
$billing = $template;
foreach($data->order_addresses_fields as $field){
$fieldname = $field->field_namekey;
$address =& $data->order_addresses[$data->cart->billing_address->address_id];
if(!empty($address->$fieldname)) $billing=str_replace('{'.$fieldname.'}',$fieldsClass->show($field,$address->$fieldname),$billing);
}


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

Thanks

Please Log in or Create an account to join the conversation.

  • Posts: 12953
  • Thank you received: 1778
11 years 2 weeks ago #128501

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->Display->Views".

The following user(s) said Thank You: suliak

Please Log in or Create an account to join the conversation.

  • Posts: 15
  • Thank you received: 0
11 years 2 weeks ago #128512

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 or Create an account to join the conversation.

  • Posts: 26151
  • Thank you received: 4027
  • MODERATOR
11 years 2 weeks ago #128623

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->show($field, $address->$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->$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 & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
The following user(s) said Thank You: suliak

Please Log in or Create an account to join the conversation.

  • Posts: 15
  • Thank you received: 0
11 years 2 weeks ago #128632

Hi,

Thanks, that makes sense to me up until the last part (the HOW of accessing ($address->$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 or Create an account to join the conversation.

Time to create page: 0.077 seconds
Powered by Kunena Forum