Customer email address to success.tpl in OpenCart

It can be done using the following code;

/catalog/controller/checkout/success.php

$this->load->model(‘account/order’);
$order = $this->model_account_order->getOrder($this->session->data[‘order_id’]);
if($order) {
$this->data[’email’] = $order[’email’];
}

 

In your template /catalog/view/theme/your-theme-name/template/common/success.tpl you need to put

<?php if(!empty($email)) echo $email; ?>

Image path Opencart

Question
I’m editing this file header.tpl inside /template/common uploaded the image at : /catalog/view/theme/TEMPLATENAME/image and I need to add

Code:
<img src=”facebook.png”>
I tried Code:
<img src=”../image/facebook.png”>
and Code:
<img src=”../../image/facebook.png”>
but the image still doesn’t show. What’s the correct image path?

Answers
all files are served from index.php so (the root)therefore your image src would be:

Code:
<img src=”catalog/view/theme/TEMPLATENAME/image/facebook.png”>
unless you are using the image in a stylesheet, then it would be Code:
url(“../image/facebook.png”)
it worked!