Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Admin Sales Totals

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 12-07-2012, 06:17 AM
  Johnwiggity's Avatar 
Johnwiggity Johnwiggity is offline
 

Advanced Member
  
Join Date: Nov 2012
Posts: 48
 

Default Admin Sales Totals

On the Dashboard is it possible to show additional reports like yesterday, last week, last month, this year in the graphic?

Here's a screenshot of what it currently says.
Attached Thumbnails
Click image for larger version

Name:	report.JPG
Views:	94
Size:	47.0 KB
ID:	3299  
__________________
4.5.4

http://www.learningguitarnow.com
Reply With Quote
  #2  
Old 12-07-2012, 08:01 AM
  totaltec's Avatar 
totaltec totaltec is offline
 

X-Guru
  
Join Date: Jan 2007
Location: Louisville, KY USA
Posts: 5,823
 

Default Re: Admin Sales Totals

There is a thread on this very subject...If I find it I'll point it out. But at least you know it is possible and the solution exists. Just need to find the needle in the haystack of this forum.
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey

XcartGuru
X-cart Tutorials | X-cart 5 Tutorials

Check out the responsive template for X-cart.
Reply With Quote
  #3  
Old 12-07-2012, 08:30 AM
  photo's Avatar 
photo photo is offline
 

X-Wizard
  
Join Date: Feb 2006
Location: UK
Posts: 1,146
 

Default Re: Admin Sales Totals

Quote:
Originally Posted by totaltec
There is a thread on this very subject...

This one? http://forum.x-cart.com/showthread.php?t=65186
__________________
v4.1.10
In Dev v4.5.x


"If you don't keep an eye on your business, someone else will."
Reply With Quote

The following user thanks photo for this useful post:
totaltec (12-07-2012)
  #4  
Old 12-07-2012, 08:32 AM
  Johnwiggity's Avatar 
Johnwiggity Johnwiggity is offline
 

Advanced Member
  
Join Date: Nov 2012
Posts: 48
 

Default Re: Admin Sales Totals

No. That's statistics and won't account for any orders other than processed.
__________________
4.5.4

http://www.learningguitarnow.com
Reply With Quote
  #5  
Old 12-07-2012, 09:29 AM
  totaltec's Avatar 
totaltec totaltec is offline
 

X-Guru
  
Join Date: Jan 2007
Location: Louisville, KY USA
Posts: 5,823
 

Default Re: Admin Sales Totals

Photo, that was the thread I had in mind. I thought it applied.

John, it looks relatively simple to do. Take a look at /admin/main.php

See line 57:
Code:
$start_dates[] = $previous_login_date; // Since last login $start_dates[] = func_prepare_search_date($curtime) - $config['Appearance']['timezone_offset']; // Today $start_week = $curtime - date('w', $curtime) * 24 * 3600; // Week starts since Sunday $start_dates[] = func_prepare_search_date($start_week) - $config['Appearance']['timezone_offset']; // Current week $start_dates[] = mktime(0, 0, 0, date('m', $curtime), 1, date('Y', $curtime)) - $config['Appearance']['timezone_offset']; // Current month
These examples should give you what you need to setup your own searches. Just subtract from $curtime the number of seconds that you want to back.

Also take a look at the foreach statement
Code:
foreach($start_dates as $start_date) {
To see how the $start_dates array is treated, to better understand what is happening here.
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey

XcartGuru
X-cart Tutorials | X-cart 5 Tutorials

Check out the responsive template for X-cart.
Reply With Quote
  #6  
Old 12-07-2012, 10:36 AM
  Johnwiggity's Avatar 
Johnwiggity Johnwiggity is offline
 

Advanced Member
  
Join Date: Nov 2012
Posts: 48
 

Default Re: Admin Sales Totals

Thanks a lot I'll try it out.
__________________
4.5.4

http://www.learningguitarnow.com
Reply With Quote
  #7  
Old 12-08-2012, 11:01 AM
  Johnwiggity's Avatar 
Johnwiggity Johnwiggity is offline
 

Advanced Member
  
Join Date: Nov 2012
Posts: 48
 

Default Re: Admin Sales Totals

Still not really sure how to change the time period. A little confused on how to actually make that into a yesterday, last week, and last month.
__________________
4.5.4

http://www.learningguitarnow.com
Reply With Quote
  #8  
Old 12-09-2012, 09:37 AM
  totaltec's Avatar 
totaltec totaltec is offline
 

X-Guru
  
Join Date: Jan 2007
Location: Louisville, KY USA
Posts: 5,823
 

Default Re: Admin Sales Totals

Well, I would have to test it out and figure it out by trial and error myself.

1 week = 604800 seconds. I expect all of the values being processed by this script are in seconds.

This defines the current week, it simply adds another entry to the array $start_dates:
$start_dates[] = func_prepare_search_date($start_week) - $config['Appearance']['timezone_offset']; // Current week

You need to do the same. I would attempt first to simply use the equation above, and subtract 604800 seconds.

Why not:
$start_dates[] = func_prepare_search_date($start_week) - $config['Appearance']['timezone_offset'] - 604800; // Last week
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey

XcartGuru
X-cart Tutorials | X-cart 5 Tutorials

Check out the responsive template for X-cart.
Reply With Quote
  #9  
Old 12-10-2012, 06:04 AM
  Johnwiggity's Avatar 
Johnwiggity Johnwiggity is offline
 

Advanced Member
  
Join Date: Nov 2012
Posts: 48
 

Default Re: Admin Sales Totals

Thanks. That helps out and gives me an idea of how to mess with it.
__________________
4.5.4

http://www.learningguitarnow.com
Reply With Quote
  #10  
Old 01-26-2013, 01:25 PM
 
minfinger minfinger is offline
 

X-Adept
  
Join Date: Apr 2009
Posts: 678
 

Default Re: Admin Sales Totals

Johnwiggity,

Did you ever figure out the line to put in the main.php to show the Year in the Admin Home?
__________________
X-Cart 4.3
Joomla
Among other things
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 10:15 PM.

   

 
X-Cart forums © 2001-2020