I have install this extension where In customer can Upload their Profile pictures
I have added another column in oc_Customer (databade) for AVATAR.
I want to show that photo to my Order list and other part of admin page.
File Name: admin/model/sale/order.php
I add New PUBLIC FUNCTION TO GET CUSTOMER _ID in ORDER_ID then Customer to Avatar Picture.
BUT SADLY NOT WORKING
Code: Select all
public function getQVAVATAR($order_id)
{
$this->load->model('sale/order');
$this->load->model('sale/customer');
$customer = $this->model_sale_order->getOrder($order_id);
$customer_info = $this->model_sale_customer->getCustomer($customer['customer_id']);
if ($customer_info) {
if ($customer_info['avatar']) {
$avatar = $this->model_tool_image->resize($customer_info['avatar'], 125, 125);
} else {
$avatar = false;
}
}
return $avatar;
}
Then adding it in controller file.
File: admin/controller/sale/order.php
$order_total = $this->model_sale_order->getTotalOrders($filter_data);
$results = $this->model_sale_order->getOrders($filter_data);
foreach ($results as $result) {
$data['orders'][] = array(
'order_id' => $result['order_id'],
'avatar'=> $this->model_sale_order->getQVAVATAR($result['order_id']),
'customer' => $result['customer'],
'status' => $result['status'],
'order_status_id' => $result['order_status_id'],
'total' => $this->currency->format($result['total'], $result['currency_code'], $result['currency_value']),
'date_added' => date($this->language->get('date_format_short'), strtotime($result['date_added'])),
'date_modified' => date($this->language->get('date_format_short'), strtotime($result['date_modified'])),
'shipping_code' => $result['shipping_code'],
'view' => $this->url->link('sale/order/info', 'token=' . $this->session->data['token'] . '&order_id=' . $result['order_id'] . $url, 'SSL'),
'edit' => $this->url->link('sale/order/edit', 'token=' . $this->session->data['token'] . '&order_id=' . $result['order_id'] . $url, 'SSL'),
'delete' => $this->url->link('sale/order/delete', 'token=' . $this->session->data['token'] . '&order_id=' . $result['order_id'] . $url, 'SSL')
);
}
Then add the in
FILE NAME: /admin/view/template/sale/order_list.tpl
<div><img src="<?php echo $order['avatar']; ?>"></div>
on the place I want it to show.
But I think I have a wrong coding in my MODEL FILE
I wish someone has know how to set codes properly.
Thank you so much