- Posts: 156
- Thank you received: 0
Add Email and telephone to Admin email
15 years 3 months ago #20337
by Rickhavoc
Add Email and telephone to Admin email was created by Rickhavoc
What do i need to change to get the email and telephone of the customer on the admin email.
I would like to have them separately under something like Contact information.
I would like to have them separately under something like Contact information.
Please Log in or Create an account to join the conversation.
15 years 3 months ago #20348
by nicolas
Replied by nicolas on topic Re: Add Email and telephone to Admin email
You need to edit the email "order admin notification" via the menu System->Emails (business edition only).
The telephone should already be in the address section.
You can display it like that:
echo $data->cart->billing_address->address_telephone;
for the email, it's:
echo $data->customer->user_email;
The telephone should already be in the address section.
You can display it like that:
echo $data->cart->billing_address->address_telephone;
for the email, it's:
echo $data->customer->user_email;
Please Log in or Create an account to join the conversation.
15 years 2 months ago #21126
by Rickhavoc
Replied by Rickhavoc on topic Re: Add Email and telephone to Admin email
i am getting the information from the custom Order Fields all slapped together in the admin email. i would like to display one by one so i can separate them. also any way of making it so that if no information is supplied that those empty fields don't show including the labels.
Thanks!
Thanks!
Please Log in or Create an account to join the conversation.
15 years 2 months ago #21138
by nicolas
Replied by nicolas on topic Re: Add Email and telephone to Admin email
The fields data is displayed by the code:
foreach($fields as $fieldName => $oneExtraField) {
echo "<br/>".$fieldsClass->trans($oneExtraField->field_realname).' : '.$fieldsClass->show($oneExtraField,$data->$fieldName);
}
So you could just change that code to what you want.
foreach($fields as $fieldName => $oneExtraField) {
echo "<br/>".$fieldsClass->trans($oneExtraField->field_realname).' : '.$fieldsClass->show($oneExtraField,$data->$fieldName);
}
So you could just change that code to what you want.
Please Log in or Create an account to join the conversation.
15 years 2 months ago #21195
by Rickhavoc
Replied by Rickhavoc on topic Re: Add Email and telephone to Admin email
i was looking for something like this for the order fields " echo $data->customer->user_email; " . would it be something like "echo $data->order->msl; " would this echo the label too?
Please Log in or Create an account to join the conversation.
15 years 2 months ago #21203
by Rickhavoc
Replied by Rickhavoc on topic Re: Add Email and telephone to Admin email
i also noticed with the code that was there the radio selection value is not being echoed out.it does the label but no value.
Please Log in or Create an account to join the conversation.
15 years 2 months ago #21214
by nicolas
Replied by nicolas on topic Re: Add Email and telephone to Admin email
echo $data->order->msl; would just display the value of the field, not the label. The label is in $oneExtraField->field_realname.
Please Log in or Create an account to join the conversation.
15 years 2 months ago #21272
by Rickhavoc
Replied by Rickhavoc on topic Re: Add Email and telephone to Admin email
so it would be echo $data->order->msl->field_realname ?
Please Log in or Create an account to join the conversation.
15 years 2 months ago #21293
by nicolas
Replied by nicolas on topic Re: Add Email and telephone to Admin email
No.
In the email, you have the code below, right ?
foreach($fields as $fieldName => $oneExtraField) {
echo "<br/>".$fieldsClass->trans($oneExtraField->field_realname).' : '.$fieldsClass->show($oneExtraField,$data->$fieldName);
}
In that foreach the variable $oneExtraField->field_realname contains the label of the field.
So:
echo $oneExtraField->field_realname;
In the email, you have the code below, right ?
foreach($fields as $fieldName => $oneExtraField) {
echo "<br/>".$fieldsClass->trans($oneExtraField->field_realname).' : '.$fieldsClass->show($oneExtraField,$data->$fieldName);
}
In that foreach the variable $oneExtraField->field_realname contains the label of the field.
So:
echo $oneExtraField->field_realname;
Please Log in or Create an account to join the conversation.
15 years 2 months ago #21297
by Rickhavoc
Replied by Rickhavoc on topic Re: Add Email and telephone to Admin email
yeah i can see that but lets say i want to echo the label and the value of the field MSL. the value of it gets echoed like this echo $data->order->msl; but how would the label of it get echoed. i want to echo these out myself without the foreach. since i want to separate some fields from the others.
Please Log in or Create an account to join the conversation.
15 years 2 months ago #21303
by nicolas
Replied by nicolas on topic Re: Add Email and telephone to Admin email
If you want to do it outside the foreach, why not just echo the label directly: echo 'My name';
Otherwise, you could try like that:
echo $fields->field_realname;
Otherwise, you could try like that:
echo $fields->field_realname;
Please Log in or Create an account to join the conversation.
15 years 2 months ago #21304
by Rickhavoc
Replied by Rickhavoc on topic Re: Add Email and telephone to Admin email
lol.. didn't think of that.. always thinking of the harder way first.. but good to know.. i am trying to get to know how the code for hikashop was written so i can create some plug-ins.
Please Log in or Create an account to join the conversation.
Time to create page: 0.234 seconds