User Tools

Site Tools


tutorials:zencartmods:daily_stats.html

Make a Daily Sales Stats Page

We like to have a quick and easy way to see how sales are doing every day.

To make one of your own, first lets make an admin page. This part is identical to the Tariff Helper File Mod, but the word phrase "edit_tariff" had been replaced with "daily_stats".

New Files:

  • admin/includes/boxes/extra_boxes/daily_stats_reports_dhtml.php
  • admin/includes/extra_datafiles/daily_stats_definitions.php
  • admin/includes/languages/english/extra_definitions/daily_stats.php
  • admin/daily_stats.php

admin/includes/boxes/extra_boxes/daily_stats_reports_dhtml.php

This filename decides which menu to put the link under. We're going to put it under "Reports", you can put it under whatever you like.

This is the entire contents of this file

<?php
$za_contents[] = array('text' => BOX_CATALOG_DAILY_STATS, 'link' => zen_href_link(FILENAME_DAILY_STATS, '', 'NONSSL'));
?>

admin/includes/extra_datafiles/daily_stats_definitions.php

This is the entire contents of this file

<?php
define('FILENAME_DAILY_STATS', 'daily_stats.php');
?>

admin/includes/languages/english/extra_definitions/daily_stats.php

All thats in this one

<?php
define('BOX_CATALOG_DAILY_STATS','daily stats');
?>

After these 3 files are created, you should have a menu item under "Reports" that looks like this.

But the link doesnt go anywhere yet, so lets make that file next.

admin/daily_stats.php

You can make the actual stats file as fancy as you like, we have a very simple and bare-bones version that you can use here.

daily_stats.php.zip

/home/ladyada/public_html/wiki/data/pages/tutorials/zencartmods/daily_stats.html.txt · Last modified: 2016/01/28 18:05 (external edit)