Hi Opencart Board...
Does anyone know what code needs to be amended to show 2 decimal places on the dashboard for "Total Sales". At the moment mine shows on GBP as XX.XXXX.
Fresh install of Opencart V2.0
Many Thanks.
Matt.
You are in luck because I just figured it out myself 
/admin/view/template/dashboard/sale.tpl

/admin/view/template/dashboard/sale.tpl
Code: Select all
<div class="tile">
<div class="tile-heading"><?php echo $heading_title; ?> <span class="pull-right">
<?php if ($percentage > 0) { ?>
<i class="fa fa-caret-up"></i>
<?php } elseif ($percentage < 0) { ?>
<i class="fa fa-caret-down"></i>
<?php } ?>
<?php echo $percentage; ?>% </span></div>
<div class="tile-body"><i class="fa fa-credit-card"></i>
<?
function numberfix($total)
{
$total = number_format($total,2,"."," ");
return str_replace(" ", " ", $total);
}
?>
<h2 class="pull-right"><?php echo "$".numberfix($total); ?></h2>
</div>
<div class="tile-footer"><a href="<?php echo $sale; ?>"><?php echo $text_view; ?></a></div>
</div>
Another (better) option would be to do it in the controller.
In "admin/controller/dashboard/sale.php", replace line 37:
with:
In "admin/controller/dashboard/sale.php", replace line 37:
Code: Select all
$data['total'] = $sale_total;
Code: Select all
$data['total'] = round($sale_total, 2);
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool
If you're not living on the edge ... you're taking up too much space!
Who is online
Users browsing this forum: No registered users and 4 guests