I'm using OpenCart 2.0 and I'm trying to show a user email on a category page when a user is logged in. The code below I believe works for it to show a users email on the success.tpl. How can I display it on a category page? Thanks for your time.
IN: /catalog/controller/product/category.php
I HAVE THIS:
$this->load->model('account/order');
$order = $this->model_account_order->getOrder($this->session->data['order_id']);
if($order) {
$this->data['email'] = $order['email'];
}
THEN IN:/catalog/view/theme/default/template/category.tpl
I HAVE THIS:
<?php if(!empty($email)) echo $email; ?>