0

I create a custom tab on the admin customer edit page. However what I want to do is get the customers email address to display on the page.

I tried to look for the code that produces the Account information tab but could not find it.

I tried something like in my app/design/adminhtml/default/default/template/customertab/tab.phtml however this seems to just break the page meaning just the first tab loads the rest of the page is blank white.

<div id="customer_info_tabs_customer_edit_tab_action_content">
<div class="entry-edit">
<div class="entry-edit-head">
<h4 class="icon-head head-edit-form fieldset-legend">Contact Customer</h4>
</div>
<div id="group_fields4" class="fieldset fieldset-wide">
<div class="hor-scroll">
<table class="form-list" cellspacing="0">
<tbody>
<tr>
<td><?php echo $this->htmlEscape($this->getCustomer()->getEmail; ?> </td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
  • have you do any other code for this?then please put that.. – Amit Bera May 7 '15 at 0:21
2

The easiest way of getting email address in customer edit section (admin side) is shown below.

$customer = Mage::registry('current_customer');
$emailAddress =  $customer->getEmail();

Magento will register the customer whose details are editing via admin in the controller action itself (refer : Mage_Adminhtml_CustomerController::editAction()) and hence you can get the customer using Mage-Registry as I shown above and get the email address.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.