Forums / Addon Admin Tools / Sales report 2.0

Sales report 2.0

Started by blindside on 29 Aug 2006, 2:41 AM · Views: 248,187

Results 781 to 800 of 882
26 Nov 2019, 11:34 AM
#781
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,139
Plugin Contributions:
56

Sales report 2.0

Speak394:

Using Zen 1.54
PHP 5.6

Will this sales report work with my set up.

I need a report to show me which products have sold the most in specific time periods.
While I've done no testing with zc154, I can't think of a reason why it wouldn't work. The good news is that it's a drop-in contribution, so if it doesn't suit your needs, it's easily removable.

26 Nov 2019, 6:10 PM
#782
speak394 avatar

speak394

New Zenner

Join Date:
Mar 2018
Location:
Alabama
Posts:
61
Plugin Contributions:
0

Re: Sales report 2.0

lat9:

While I've done no testing with zc154, I can't think of a reason why it wouldn't work. The good news is that it's a drop-in contribution, so if it doesn't suit your needs, it's easily removable.

I did try this yesterday. Although everything went in place, no errors showed up nor did it crash the site. I could not generate a report. When I clicked on show me the money, it did nothing.

26 Nov 2019, 8:46 PM
#783
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,139
Plugin Contributions:
56

Re: Sales report 2.0

Speak394:

I did try this yesterday. Although everything went in place, no errors showed up nor did it crash the site. I could not generate a report. When I clicked on show me the money, it did nothing.
Did you unclick the "Open the report in a new window"? Otherwise, the report is created in a new tab/window.

26 Nov 2019, 10:47 PM
#784
speak394 avatar

speak394

New Zenner

Join Date:
Mar 2018
Location:
Alabama
Posts:
61
Plugin Contributions:
0

Re: Sales report 2.0

Yes, I tried it both ways. Neither way created a report. It was like the button was not working.

27 Nov 2019, 12:47 PM
#785
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,139
Plugin Contributions:
56

Re: Sales report 2.0

Speak394:

Yes, I tried it both ways. Neither way created a report. It was like the button was not working.
Yes, I misspoke. The Sales Report now uses jQuery (loaded for zc155 and later), so it's no longer compatible with prior Zen Cart versions.

28 Nov 2019, 4:10 PM
#786
a02l1zz avatar

a02l1zz

New Zenner

Join Date:
Nov 2009
Posts:
27
Plugin Contributions:
0

Re: Sales report 2.0

lat9:

@creyesx6, thanks for "sticking with me" on this. After inspection, the issue is that the plugin's menu-bar addition occurs when the 'extra_functions' load ... which is prior to the admin's session initialization.

Unfortunately, that extra_functions processing is checking to see if an admin session is currently active (which it won't be based on the load-point of the processing).

I'll be updating the Sales Report plugin to remove that "is an admin active?" check to allow the menu-bar registration to complete successfully.

Hi Lat9,

Last night I upgraded to 1.5.6c from 1.3.9h, after a number of issues with robots creating new accounts and sending SPAM to the emails used in the account creations. The upgrade went well, and I was able to add the reCAPTCHA plugin and that has solved that unwanted activity.

Anyhow, I have used the Sales Report tool on 1.3.9h since 2010. After the upgrade, the tool went away,even though the the files were still there. I decided to move to the latest version, and copied over and replaced the existing files, however, the Sales Report isn't showing in the Reports Section of the Menu Bar.

Looking at the previous threads here, I see that there was some sort of small glitch, that needs to be addressed, but I am trying to figure out what exactly I need to do in the mean time to get the reporting tool to show up.

Is it just a simple matter of adding the a page_key named stats_sales_report to the admin_pages table to resolve the issue?

James

28 Nov 2019, 5:14 PM
#787
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,139
Plugin Contributions:
56

Re: Sales report 2.0

a02l1zz:

Hi Lat9,

Last night I upgraded to 1.5.6c from 1.3.9h, after a number of issues with robots creating new accounts and sending SPAM to the emails used in the account creations. The upgrade went well, and I was able to add the reCAPTCHA plugin and that has solved that unwanted activity.

Anyhow, I have used the Sales Report tool on 1.3.9h since 2010. After the upgrade, the tool went away,even though the the files were still there. I decided to move to the latest version, and copied over and replaced the existing files, however, the Sales Report isn't showing in the Reports Section of the Menu Bar.

Looking at the previous threads here, I see that there was some sort of small glitch, that needs to be addressed, but I am trying to figure out what exactly I need to do in the mean time to get the reporting tool to show up.

Is it just a simple matter of adding the a page_key named stats_sales_report to the admin_pages table to resolve the issue?

James
James, you can replace the contents of /YOUR_ADMIN/includes/functions/extra_functions/sales_report.php with the following contents to correct the issue. That's the version in the forthcoming v3.3.3 of the Sales Report:

<?php
/**
 * SALES REPORT 3.3.3
 *
 * @author     Frank Koehl (PM: BlindSide)
 * @author     Conor Kerr <[email protected]>
 * @updated by stellarweb to work with version 1.5.0 02-29-12
 * @updated by lat9, supporting zc1.5.5/1/5.6, 2019-11-02
 * @copyright  Portions Copyright 2003-2006 Zen Cart Development Team
 * @copyright  Portions Copyright 2003 osCommerce
 * @license    http://www.gnu.org/copyleft/gpl.html   GNU Public License V2.0
*/
if (!defined('IS_ADMIN_FLAG')) {
    die('Illegal Access');
}

// -----
// Bail the required function isn't loaded, e.g. if a currency-cron is running.
//
if (!function_exists('zen_page_key_exists')) {
    return;
}

// -----
// If the report's page-key entry doesn't net exist, add it.
//
if (!zen_page_key_exists('stats_sales_report')) {
    zen_register_admin_page('stats_sales_report', 'BOX_REPORTS_SALES_REPORT', 'FILENAME_STATS_SALES_REPORT', '', 'reports', 'Y');
}
28 Nov 2019, 6:31 PM
#788
a02l1zz avatar

a02l1zz

New Zenner

Join Date:
Nov 2009
Posts:
27
Plugin Contributions:
0

Re: Sales report 2.0

lat9:

James, you can replace the contents of /YOUR_ADMIN/includes/functions/extra_functions/sales_report.php with the following contents to correct the issue. That's the version in the forthcoming v3.3.3 of the Sales Report:

<?php /** * SALES REPORT 3.3.3 * * @author Frank Koehl (PM: BlindSide) * @author Conor Kerr <[email protected]> * @updated by stellarweb to work with version 1.5.0 02-29-12 * @updated by lat9, supporting zc1.5.5/1/5.6, 2019-11-02 * @copyright Portions Copyright 2003-2006 Zen Cart Development Team * @copyright Portions Copyright 2003 osCommerce * @license http://www.gnu.org/copyleft/gpl.html GNU Public License V2.0 */ if (!defined('IS_ADMIN_FLAG')) { die('Illegal Access'); } // ----- // Bail the required function isn't loaded, e.g. if a currency-cron is running. // if (!function_exists('zen_page_key_exists')) { return; } // ----- // If the report's page-key entry doesn't net exist, add it. // if (!zen_page_key_exists('stats_sales_report')) { zen_register_admin_page('stats_sales_report', 'BOX_REPORTS_SALES_REPORT', 'FILENAME_STATS_SALES_REPORT', '', 'reports', 'Y'); } ``` Lat9, Thank you very much. That worked great. One thing to clear up in relation to your post. I believe the path is: /YOUR_ADMIN/includes/functions/extra_functions/**stats_**sales_report.php not /YOUR_ADMIN/includes/functions/extra_functions/sales_report.php, based on what I was seeing in the folder structure. Also, in the following line, you have a "/" instead of a "." for 1.5.6, not that this really matters. * @updated by lat9, supporting zc1.5.5/1/5.6, 2019-11-02 Regards James
28 Nov 2019, 7:16 PM
#789
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,139
Plugin Contributions:
56

Re: Sales report 2.0

James, thanks for the corrections; I'll get that commentary updated for the v3.3.3 release.

26 Jan 2020, 12:40 PM
#790
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,139
Plugin Contributions:
56

Re: Sales report 2.0

I've just submitted v3.3.3 of the Sales Report to the Zen Cart moderators for review; I'll post back here when it's available for download.

 This release contains changes associated with the following GitHub issues:

#18: Correct "missing" admin menu-entry on initial installations.
#19: Correct incorrect tax calculation
#20: "Suggest" a .csv file extension on CSV downloads
#21: Move menu-name into a language extra-definition (enables translation).
#22: Enable date-formatting overrides.

1 Feb 2020, 4:44 PM
#791
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,139
Plugin Contributions:
56

Re: Sales report 2.0

lat9:

I've just submitted v3.3.3 of the Sales Report to the Zen Cart moderators for review; I'll post back here when it's available for download.

 This release contains changes associated with the following GitHub issues:

#18: Correct "missing" admin menu-entry on initial installations.
#19: Correct incorrect tax calculation
#20: "Suggest" a .csv file extension on CSV downloads
#21: Move menu-name into a language extra-definition (enables translation).
#22: Enable date-formatting overrides.
Now available for download: https://www.zen-cart.com/downloads.php?do=file&id=9

18 Oct 2020, 12:45 AM
#792
oldngrey avatar

oldngrey

Zen Follower

Join Date:
Apr 2008
Location:
Qld, Australia
Posts:
433
Plugin Contributions:
0

Re: Sales report 2.0

I have been using this plug-in for a long time across many iterations and zc versions. Very Nice.
I didn't have to make any corrections at all for zc1.5.7. Dates are formatted to suit the host system and prints well on A4.

OldNGrey
ZC222 PHP 8.4.27
MySQL 11.8.5-MariaDB

18 Oct 2020, 10:37 AM
#793
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,139
Plugin Contributions:
56

Re: Sales report 2.0

OldNGrey:

I have been using this plug-in for a long time across many iterations and zc versions. Very Nice.
I didn't have to make any corrections at all for zc1.5.7. Dates are formatted to suit the host system and prints well on A4.
That's great news! Thanks for the report.

28 Oct 2020, 9:35 PM
#794
webangel avatar

webangel

New Zenner

Join Date:
Oct 2019
Location:
London, UK
Posts:
22
Plugin Contributions:
0

Re: Sales report 2.0

What is the latest version of the sale report, where can I find the version my store is using?
Our Admin Store report needs updating, the layout is outdated and confusing, its long overdue an update!!

29 Oct 2020, 12:24 AM
#795
oldngrey avatar

oldngrey

Zen Follower

Join Date:
Apr 2008
Location:
Qld, Australia
Posts:
433
Plugin Contributions:
0

Re: Sales report 2.0

It is written at the top of the file admin\stats_sales_report.php

OldNGrey
ZC222 PHP 8.4.27
MySQL 11.8.5-MariaDB

28 Jan 2021, 5:54 PM
#796
sjsheu avatar

sjsheu

New Zenner

Join Date:
Jul 2020
Location:
San Jose, CA
Posts:
1
Plugin Contributions:
0

Re: Sales report 2.0

There is a small bug with respect to the selection of the payment_methods. Here is a fix that could be considered.

diff --git a/includes/modules/.sales_report-3.3.3/YOUR_ADMIN/stats_sales_report.php b/includes/modules/.sales_report-3.3.3/YOUR_ADMIN/stats_sales_report.php
index 7f74a19..1cd7a3d 100644
--- a/includes/modules/.sales_report-3.3.3/YOUR_ADMIN/stats_sales_report.php
+++ b/includes/modules/.sales_report-3.3.3/YOUR_ADMIN/stats_sales_report.php
@@ -222,8 +222,8 @@ if ($date_target == 'status') {
$date_status = false;
}

-$payment_method = (isset($_GET['payment_method']) && in_array($_GET['payment_method'], $payment_key)) ? $_GET['payment_method'] : '0';
-$payment_method_omit = (isset($_GET['payment_method_omit']) && in_array($_GET['payment_method_omit'], $payment_key)) ? $_GET['payment_method_omit'] : '0';
+$payment_method = (isset($_GET['payment_method']) && array_key_exists($_GET['payment_method'], $payment_key)) ? $_GET['payment_method'] : '0';
+$payment_method_omit = (isset($_GET['payment_method_omit']) && array_key_exists($_GET['payment_method_omit'], $payment_key)) ? $_GET['payment_method_omit'] : '0';
$current_status = (isset($_GET['current_status']) && array_key_exists((int)$_GET['current_status'], $status_key)) ? (int)$_GET['current_status'] : 0;
$excluded_status = (isset($_GET['excluded_status']) && array_key_exists((int)$_GET['excluded_status'], $status_key)) ? (int)$_GET['excluded_status'] : 0;
$manufacturer = (isset($_GET['manufacturer']) && in_array((int)$_GET['manufacturer'], $manufacturer_key)) ? (int)$_GET['manufacturer'] : 0;

28 Jan 2021, 8:58 PM
#797
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,139
Plugin Contributions:
56

Re: Sales report 2.0

sjsheu:

There is a small bug with respect to the selection of the payment_methods. Here is a fix that could be considered.

diff --git a/includes/modules/.sales_report-3.3.3/YOUR_ADMIN/stats_sales_report.php b/includes/modules/.sales_report-3.3.3/YOUR_ADMIN/stats_sales_report.php
index 7f74a19..1cd7a3d 100644
--- a/includes/modules/.sales_report-3.3.3/YOUR_ADMIN/stats_sales_report.php
+++ b/includes/modules/.sales_report-3.3.3/YOUR_ADMIN/stats_sales_report.php
@@ -222,8 +222,8 @@ if ($date_target == 'status') {
$date_status = false;
}

-$payment_method = (isset($_GET['payment_method']) && in_array($_GET['payment_method'], $payment_key)) ? $_GET['payment_method'] : '0';
-$payment_method_omit = (isset($_GET['payment_method_omit']) && in_array($_GET['payment_method_omit'], $payment_key)) ? $_GET['payment_method_omit'] : '0';
+$payment_method = (isset($_GET['payment_method']) && array_key_exists($_GET['payment_method'], $payment_key)) ? $_GET['payment_method'] : '0';
+$payment_method_omit = (isset($_GET['payment_method_omit']) && array_key_exists($_GET['payment_method_omit'], $payment_key)) ? $_GET['payment_method_omit'] : '0';
$current_status = (isset($_GET['current_status']) && array_key_exists((int)$_GET['current_status'], $status_key)) ? (int)$_GET['current_status'] : 0;
$excluded_status = (isset($_GET['excluded_status']) && array_key_exists((int)$_GET['excluded_status'], $status_key)) ? (int)$_GET['excluded_status'] : 0;
$manufacturer = (isset($_GET['manufacturer']) && in_array((int)$_GET['manufacturer'], $manufacturer_key)) ? (int)$_GET['manufacturer'] : 0;
Thanks for the report and the required correction! I'll get that updated for the next release of the Sales Report.

29 Jan 2021, 1:16 PM
#798
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,139
Plugin Contributions:
56

Re: Sales report 2.0

I've just submitted v3.4.0 of the Sales Report for the Zen Cart moderators' review; I'll post back here when it's available for download.

This release contains changes associated with the following GitHub issues:

#24: Additional discount- and fee-related order totals. (thanks, @swguy)
#25: Correct handling of 'payment_method' and 'payment_method_omit' filters (thanks, @sjsheu).

1 Feb 2021, 2:53 PM
#799
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,139
Plugin Contributions:
56

Re: Sales report 2.0

lat9:

I've just submitted v3.4.0 of the Sales Report for the Zen Cart moderators' review; I'll post back here when it's available for download.

This release contains changes associated with the following GitHub issues:

#24: Additional discount- and fee-related order totals. (thanks, @swguy)
#25: Correct handling of 'payment_method' and 'payment_method_omit' filters (thanks, @sjsheu).
Now available for download: https://www.zen-cart.com/downloads.php?do=file&id=9

10 Feb 2021, 4:59 PM
#800
greg_beyer avatar

greg_beyer

New Zenner

Join Date:
Mar 2016
Location:
Marietta GA
Posts:
85
Plugin Contributions:
0

Re: Sales report 2.0

Hello, I'm seeking an example of the report it can create. In particular, does it capture product category as well as product name, sales count order date, and price in the report?

I found a discussion of category inclusion back in 2017, but don't know if it was implemented.

Thanks