Add Email and telephone to Admin email

  • Posts: 156
  • Thank you received: 0
12 years 10 months ago #20337

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.

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

  • Posts: 81564
  • Thank you received: 13072
  • MODERATOR
12 years 10 months ago #20348

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;

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

  • Posts: 156
  • Thank you received: 0
12 years 9 months ago #21126

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! :)

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

  • Posts: 81564
  • Thank you received: 13072
  • MODERATOR
12 years 9 months ago #21138

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.

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

  • Posts: 156
  • Thank you received: 0
12 years 9 months ago #21195

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.

  • Posts: 156
  • Thank you received: 0
12 years 9 months ago #21203

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.

  • Posts: 81564
  • Thank you received: 13072
  • MODERATOR
12 years 9 months ago #21214

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.

  • Posts: 156
  • Thank you received: 0
12 years 9 months ago #21272

so it would be echo $data->order->msl->field_realname ?

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

  • Posts: 81564
  • Thank you received: 13072
  • MODERATOR
12 years 9 months ago #21293

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;

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

  • Posts: 156
  • Thank you received: 0
12 years 9 months ago #21297

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.

  • Posts: 81564
  • Thank you received: 13072
  • MODERATOR
12 years 9 months ago #21303

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;

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

  • Posts: 156
  • Thank you received: 0
12 years 9 months ago #21304

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.075 seconds
Powered by Kunena Forum