mkh wrote:I'm using 1.5.1.1
Hi mkh,
Have you made any adjustments to the layout in admin?
I have just tried the same method on my demo page using 1.5.1.1 & it works fine.
You need to open & edit all the following files with the extra codes...
Open Admin->Controller->Common->home.php & Find...
Code: Select all
$this->data['total_order'] = $this->model_sale_order->getTotalOrders();
& after add (next line)...
Code: Select all
$this->load->model('catalog/product');
$this->data['total_quantity'] = $this->model_catalog_product->getTotalQuantity();
Then open Admin->Language->Common->home.php find...
Code: Select all
$_['text_total_order'] = 'Total Orders:';
& after add...
Code: Select all
$_['text_total_quantity'] = 'Total items:';
Then in Admin->Model->Catalog->Product.php find...
Code: Select all
public function getTotalProductsByStockStatusId($stock_status_id) {
then BEFORE that line add...
Code: Select all
public function getTotalQuantity($data = array()) {
$sql = "SELECT SUM( quantity ) AS total FROM product";
$query = $this->db->query($sql);
return $query->row['total'];
}
& finally open Admin->View->Template->Common->home.tpl & find...
Code: Select all
<tr>
<td><?php echo $text_total_order; ?></td>
<td><?php echo $total_order; ?></td>
</tr>
then after add...
Code: Select all
<tr>
<td><?php echo $text_total_quantity; ?></td>
<td align="right"><?php echo $total_quantity; ?></td>
</tr>
<tr>
This will show an extra line called 'Total Items' in admin front page (Dashboard) & below Total Orders

If you havn't made any changes to the Admin side of OC1.5.1.1 I can put this together so you would just need to upload the folder & it will install the code

otherwise, the above way is the manual way.