- Posts: 15
- Thank you received: 0
Confirmation email address field order
12 years 11 months ago #128485
by suliak
Confirmation email address field order was created by suliak
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
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.
Less
More
- Posts: 12953
- Thank you received: 1778
12 years 11 months ago #128501
by Mohamed Thelji
Replied by Mohamed Thelji on topic Confirmation email address field order
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".
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.
12 years 11 months ago #128512
by suliak
Replied by suliak on topic Confirmation email address field order
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.
12 years 11 months ago #128623
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Replied by Jerome on topic Confirmation email address field order
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,
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.
The following user(s) said Thank You: suliak
Please Log in or Create an account to join the conversation.
12 years 11 months ago #128632
by suliak
Replied by suliak on topic Confirmation email address field order
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.
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.172 seconds