Page 1 of 1
Display Total Sales with $ (dollar sign) in Dashboard
Posted: Mon May 09, 2016 12:23 am
by kavlito
While setting up and testing my first OpenCart, I was very confused after creating my first test order that the Dashboard showed I had 55 Total Sales, when I only had 1. After pecking around I realized that my test order total was $54.85. So I realized that the Total Sales on the Dashboard is rounded up sales dollars. However, without displaying as currency, it is very confusing and misleading.
To display correctly as currency, make the following edit:
/ocart2/admin/view/template/dashboard/sale.tpl
Change line 10 from:
<h2 class="pull-right"><?php echo $total; ?></h2>
To:
<h2 class="pull-right"><?php echo '$' .$total; ?></h2>
If not using USD, change the '$' to your currency symbol.
total sales dashboard2.jpg (19.57 KiB) Viewed 2762 times
total sales dashboard.jpg (20.91 KiB) Viewed 2762 times
Re: Display Total Sales with $ (dollar sign) in Dashboard
Posted: Mon May 09, 2016 2:29 am
by IP_CAM
I could not resist, to try, to make it automatically displaying the active Currency,
and, to my surprise, it even worked on spot!
But one could try, to define/declare the Symbol Variable,
instead of the Short Currency word, about the same way, I assume.
Just keeping the 'H2' in line, was not possible, so, I changed to font-size 38px., to match
visually, more or less... (for OC v.2.2 - v.1.5.6.x uses it by default!)
Just to mention it!
Ernie
Here is simple VqMod!
currency_to_admin_dashboard.xml
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<modification>
<id><![CDATA[Add Currency Shortword to Admin Dashboard]]></id>
<version><![CDATA[OC v.2.x]]></version>
<vqmver><![CDATA[2.6]]></vqmver>
<author><![CDATA[Ernie - IP_CAM]]></author>
<file name="admin/view/template/dashboard/sale.tpl">
<operation error="log">
<search position="replace"><![CDATA[<h2 class="pull-right"><?php echo $total; ?></h2>]]></search>
<add><![CDATA[<div class="pull-right"><?php echo $currency_code; ?> <span style="font-size:38px;"><?php echo $total; ?></span></div>]]></add>
</operation>
</file>
<file name="admin/controller/dashboard/sale.php">
<operation error="log">
<search position="after"><![CDATA[$this->load->model('report/sale');]]></search>
<add><![CDATA[$data['currency_code'] = $this->config->get('config_currency');]]></add>
</operation>
<operation error="log">
<search position="after"><![CDATA[$sale_total = $this->model_report_sale->getTotalSales();]]></search>
<add><![CDATA[$data['currency_code'] = $data['currency_code'];]]></add>
</operation>
</file>
</modification>
Re: Display Total Sales with $ (dollar sign) in Dashboard
Posted: Mon Feb 20, 2017 6:22 pm
by ayhanopenchart
For Version 2.3.0.2 this tpl file:
admin/view/template/extension/dashboard/sale_info.tpl
TL simgesi eklemek için bu eklentiyi kullanabilirsiniz: (Use this vqmod for Add TL symbol. Turkish Lira. You can change easily for $.)
https://www.opencart.com/index.php?rout ... 4%B1%C5%9F
Re: Display Total Sales with $ (dollar sign) in Dashboard
Posted: Sat Nov 10, 2018 7:31 am
by Greggaz
IP_CAM wrote: ↑Mon May 09, 2016 2:29 am
I could not resist, to try, to make it automatically displaying the active Currency,
and, to my surprise, it even worked on spot!
But one could try, to define/declare the Symbol Variable,
instead of the Short Currency word, about the same way, I assume.
Just keeping the 'H2' in line, was not possible, so, I changed to font-size 38px., to match
visually, more or less... (for OC v.2.2 - v.1.5.6.x uses it by default!)
Just to mention it!
Ernie
Here is simple VqMod!
currency_to_admin_dashboard.xml
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<modification>
<id><![CDATA[Add Currency Shortword to Admin Dashboard]]></id>
<version><![CDATA[OC v.2.x]]></version>
<vqmver><![CDATA[2.6]]></vqmver>
<author><![CDATA[Ernie - IP_CAM]]></author>
<file name="admin/view/template/dashboard/sale.tpl">
<operation error="log">
<search position="replace"><![CDATA[<h2 class="pull-right"><?php echo $total; ?></h2>]]></search>
<add><![CDATA[<div class="pull-right"><?php echo $currency_code; ?> <span style="font-size:38px;"><?php echo $total; ?></span></div>]]></add>
</operation>
</file>
<file name="admin/controller/dashboard/sale.php">
<operation error="log">
<search position="after"><![CDATA[$this->load->model('report/sale');]]></search>
<add><![CDATA[$data['currency_code'] = $this->config->get('config_currency');]]></add>
</operation>
<operation error="log">
<search position="after"><![CDATA[$sale_total = $this->model_report_sale->getTotalSales();]]></search>
<add><![CDATA[$data['currency_code'] = $data['currency_code'];]]></add>
</operation>
</file>
</modification>
Hi Guys,
I was just wondering if there was an update to this vqmod? I'm looking to utilise this on my OpenCart website.
Any help would be greatly appreciated
Thanks
Jonathan
Re: Display Total Sales with $ (dollar sign) in Dashboard
Posted: Sat Nov 10, 2018 5:01 pm
by OSWorX
Re: Display Total Sales with $ (dollar sign) in Dashboard
Posted: Sat Nov 10, 2018 8:39 pm
by Greggaz
Hi,
Thanks for providing the addon - I've added this to my OpenCart website and nothing seems to happen.
Are there any instructions I could follow?
Re: Display Total Sales with $ (dollar sign) in Dashboard
Posted: Sat Nov 10, 2018 8:56 pm
by OSWorX
Greggaz wrote: ↑Sat Nov 10, 2018 8:39 pm
Hi,
Thanks for providing the addon - I've added this to my OpenCart website and nothing seems to happen.
Are there any instructions I could follow?
No - which version are you using and how did you install?
Re: Display Total Sales with $ (dollar sign) in Dashboard
Posted: Sun Nov 11, 2018 5:28 am
by straightlight
Re: Display Total Sales with $ (dollar sign) in Dashboard
Posted: Sun Nov 11, 2018 6:05 am
by OSWorX
Maybe resolved, just another approach - both should work.