Twitch.
https://www.twitchtoo.com Do you work for free? Please donate.
June 7.2026 - NOW AVAILABLE - Twitch Base8 - Obsidian
It's not "just an improvement" if you rebrand it completely, which you have done.
You have also changed filenames, (again, to reflect your own branding), which makes it different from a simple bug fix update.
Please resubmit as new so I can submit required fixes to the old module.
That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.
I have been using this plugin for a few years and it used to work very well for my needs.
Some time ago I upgraded Zencart to 1.5.7d (due to the fact that my hosting provider forced pHp 8.0 on me).
I also upgraded to the latest version of this plugin 1.9.3.
At the time I noticed an error: It was no longer possible to select a category from the drop-down list (the plugin just returns to the admin home page). I could still download the CSV for all products (but had to split the categories in Excel). Now I would really like to see if it can be fixed.
It will be much appreciated if anyone can maybe help me here! Is this perhaps a pHp 8.0 issues?
The error log shows the following:
[20-Sep-2023 09:15:42 UTC] PHP Notice: Undefined index: cat in /Admin/stats_inventory_report.php on line 46
[20-Sep-2023 09:15:42 UTC] PHP Notice: Undefined index: dir in /Admin/stats_inventory_report.php on line 47
[20-Sep-2023 09:15:42 UTC] PHP Notice: Undefined index: sort in /Admin/stats_inventory_report.php on line 48
[20-Sep-2023 09:15:42 UTC] PHP Notice: Undefined index: page in /Admin/stats_inventory_report.php on line 49
[20-Sep-2023 09:15:42 UTC] PHP Notice: Undefined index: mfg in /Admin/stats_inventory_report.php on line 50
[20-Sep-2023 09:15:42 UTC] PHP Notice: Undefined index: status in /Admin/stats_inventory_report.php on line 51
[20-Sep-2023 09:15:42 UTC] PHP Notice: Undefined index: csv in /Admin/stats_inventory_report.php on line 52
[20-Sep-2023 09:15:42 UTC] PHP Notice: Undefined variable: replace_dir in /Admin/stats_inventory_report.php on line 187
[20-Sep-2023 09:15:42 UTC] PHP Notice: Undefined variable: dir_model in /Admin/stats_inventory_report.php on line 200
[20-Sep-2023 09:15:42 UTC] PHP Notice: Undefined variable: total in /Admin/stats_inventory_report.php on line 231
Update on the above problem. I managed to get rid of the above errors by applying the isset function on all these variables.
However, the same thing happens: when I try to select a category, the page just returns to ZenCart home page.
Strangely, no new error are logged...
Any ideas anyone?
Hello
Is it possible to filter the data on category? Rather than displaying the filtered results, clicking on a category redirects me to the admin home page
just updating the correct code for this
Replace
<form method="get" action="<?php echo zen_href_link(FILENAME_STATS_INVENTORY_REPORT, 'page='.$get_page.'&dir='.$replace_dir.'&sort=replace_sort', 'SSL'); ?>"><?php echo zen_draw_pull_down_menu('cat', zen_get_category_tree(), $cat, 'onChange="this.form.submit();"'); ?></form>
with
<form method="get" action="stats_inventory_report.php"><?php echo zen_draw_pull_down_menu('cat', zen_get_category_tree(), $cat, 'onChange="this.form.submit();"'); ?></form>
</form>
Also to show only the enabled products change code to
$products_query_raw = "SELECT p.products_id, p.products_quantity, pd.products_name, p.products_model, p.products_price, (p.products_quantity * p.products_price) AS total, cd.categories_name, p.products_cost, m.manufacturers_name
FROM " . TABLE_PRODUCTS . " p
LEFT JOIN " . TABLE_PRODUCTS_DESCRIPTION . " pd ON p.products_id = pd.products_id
LEFT JOIN " . TABLE_CATEGORIES_DESCRIPTION . " cd ON p.master_categories_id = cd.categories_id AND cd.language_id = '" . $lang_id . "'
LEFT JOIN " . TABLE_MANUFACTURERS . " m ON p.manufacturers_id = m.manufacturers_id
" . $db_category_where . "
GROUP BY p.products_id, pd.products_name
HAVING p.products_status = '1'
ORDER BY " . $sort . " " . $dir;
thanks
Last edited by nishajh; 9 May 2024 at 03:21 AM.
I've refactored this plugin to support Zen Cart 2.x and it is now an Encapsulated Plugin. Updated version is available on Github: https://github.com/zenexpert/inventory-report