Post by kavlito » Mon May 09, 2016 12:23 am

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

total sales dashboard2.jpg (19.57 KiB) Viewed 2760 times

total sales dashboard.jpg

total sales dashboard.jpg (20.91 KiB) Viewed 2760 times


Newbie

Posts

Joined
Fri Mar 11, 2016 7:43 pm

Post by IP_CAM » 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! :o 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 :D

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>

My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by ayhanopenchart » Mon Feb 20, 2017 6:22 pm

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


Posts

Joined
Mon Feb 20, 2017 6:15 pm

Post by Greggaz » Sat Nov 10, 2018 7:31 am

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! :o 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 :D

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

Newbie

Posts

Joined
Sat Nov 10, 2018 7:30 am

Post by OSWorX » Sat Nov 10, 2018 5:01 pm

Simply go here: https://www.opencart.com/index.php?rout ... n_id=35486
Compatible with OC 2.3.x and 3.x

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Guru Member

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria

Post by Greggaz » 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?

Newbie

Posts

Joined
Sat Nov 10, 2018 7:30 am

Post by OSWorX » Sat Nov 10, 2018 8:56 pm

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?

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Guru Member

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria

Post by straightlight » Sun Nov 11, 2018 5:28 am


Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by OSWorX » Sun Nov 11, 2018 6:05 am

straightlight wrote:
Sun Nov 11, 2018 5:28 am
Resolved here: viewtopic.php?f=202&t=208179#p739641
Maybe resolved, just another approach - both should work.

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Guru Member

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria
Who is online

Users browsing this forum: No registered users and 71 guests