-
ZC Inventory Report Module
Zen Cart Inventory Report Module v 1.6
https://www.zen-cart.com/downloads.php?do=file&id=1365
This Zen Cart Report module allows for you to check stock levels of the products
in your Zen Cart store. Values included in the table style report are:
Product ID
Quantity in Stock
Product title
Master category
Product Price
Extended Retail value of stock on hand
Included in this report is the ability to sort all of the values above
ascending/descending as well as viewing all or paginating the stock and drop
down filter to show this report by category instead of all products
-
Re: ZC Inventory Report Module
Hi,
I'm getting the following error on v1.5:
"Parse error: syntax error, unexpected '}' in ..\my_admin\stats_inventory_report.php on line 160"
And the following error on 1.3.9h:
"Parse error: syntax error, unexpected '}' in ..\my_admin_zen\stats_inventory_report.php on line 191"
:blink:
-
Re: ZC Inventory Report Module
PHP version?
This module is currently running w/o the error you reported on an array of 1.3.7 to 1.5.0 carts numbering in the 50 to 60ish.
So please answer the following:
PHP version?
Modules installed?
The statement, the same in both below is properly closed. I would suspect an error related specifically to your own hosted environment, cart, mods etc.
Quote:
<? if(is_object($products_split)) {?>
<tr>
<td colspan="3"><table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
<td class="smallText" valign="top"><?php echo $products_split->display_count($products_query_numrows, MAX_DISPLAY_SEARCH_RESULTS_REPORTS, $_GET['page'], TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></td>
<td class="smallText" align="right"><?php echo $products_split->display_links($products_query_numrows, MAX_DISPLAY_SEARCH_RESULTS_REPORTS, MAX_DISPLAY_PAGE_LINKS, $_GET['page'], "sort=$sort&dir=$dir&cat=$cat"); ?></td>
</tr>
</table></td>
</tr>
<?php } ?>
-
Re: ZC Inventory Report Module
Weird.
PHP version: 5.3.10
Addons: 0
Looks like a very handle little addon, I really want to get it working on my store.
-
Re: ZC Inventory Report Module
It is not PHP 5.3 compatible, sorry
-
Re: ZC Inventory Report Module
Ah, I see.
Thanks for getting back to me.
-
Re: ZC Inventory Report Module
I installed this module per the directions and even after refreshing my Admin panel I am not seeing this option in my Reports menu.
-
Re: ZC Inventory Report Module
Please disregard my post. I resolved the issue.
-
Re: ZC Inventory Report Module
Quote:
Originally Posted by
gaffettape
Hi,
I'm getting the following error on v1.5:
"Parse error: syntax error, unexpected '}' in ..\my_admin\stats_inventory_report.php on line 160"
And the following error on 1.3.9h:
"Parse error: syntax error, unexpected '}' in ..\my_admin_zen\stats_inventory_report.php on line 191"
:blink:
I got the same error.
To fix it go to line 151 where it says
Quote:
<? if(is_object($products_split)) {?>
and replace it with
Quote:
<?php if(is_object($products_split)) {?>
Using zen 1.5
php 5.39
There is also another error which cause the following bug down the bottom of the page where the totals are
format($total); ?>
line 147
Quote:
<td class="dataTableHeadingContent" align="right"><?echo $currencies->format($total); ?></td>
replace with
Quote:
<td class="dataTableHeadingContent" align="right"><?php echo $currencies->format($total); ?></td>
-
Re: ZC Inventory Report Module
I recently installed the MOD into a ZC v150 installation. Everything works fine except that I and am having trouble with Admin Security Functionality. Despite the fact that I selected the add-on in several profiles, I receive a 'Sorry, your security clearance does not allow you to access this resource' message using any account other than SuperUser.
Any guidance is greatly appreciated!
-
Re: ZC Inventory Report Module
Quote:
Originally Posted by
Stizzed
I recently installed the MOD into a ZC v150 installation. Everything works fine except that I and am having trouble with Admin Security Functionality. Despite the fact that I selected the add-on in several profiles, I receive a 'Sorry, your security clearance does not allow you to access this resource' message using any account other than SuperUser.
Any guidance is greatly appreciated!
That one might be a different issue all together. Have you other modules installed and can alter their usage in other profiles?
-
Re: ZC Inventory Report Module
Quote:
Originally Posted by
mprough
That one might be a different issue all together. Have you other modules installed and can alter their usage in other profiles?
Yes. There are several add-ons installed which work perfectly with Admin Security. An example would be SALES REPORT (Judy Gunderson), recently updated for v150.
-
Re: ZC Inventory Report Module
Seems odd, as the page register simply adds it to the registered pages. It has nothing to do with the profile function itself.
-
Re: ZC Inventory Report Module
Quote:
Originally Posted by
mprough
Seems odd, as the page register simply adds it to the registered pages. It has nothing to do with the profile function itself.
I asked for guidance regarding the Admin Profile Security functionality in the General Questions Forum. However, after nearly 100 looks I have gotten no responses other than to refer me to this thread.
After reading through some of the newer threads regarding Admin Profile Security it could be that I may not posses the credentials to warrant responses to those inquiries. And I have to guess that if it ~is~ discussed I simply haven't entered the correct search terms :dontgetit
-
Re: ZC Inventory Report Module
-
Re: ZC Inventory Report Module
Quote:
Originally Posted by
mprough
Thank you for the above.
I implemented the referenced fix, removed the entry from admin_pages, refreshed and reconfigured the profile, and still the problem persists...
-
Re: ZC Inventory Report Module
I will confirm that i am getting the same error on a
zen 1.5
php 5.3.9
store
the only changes I have made to the mod have been the changes mentioned in my previous post, which were required to get the mod to work correctly
Quote:
Originally Posted by
Stizzed
I recently installed the MOD into a ZC v150 installation. Everything works fine except that I and am having trouble with Admin Security Functionality. Despite the fact that I selected the add-on in several profiles, I receive a 'Sorry, your security clearance does not allow you to access this resource' message using any account other than SuperUser.
Any guidance is greatly appreciated!
-
Re: ZC Inventory Report Module
Tried installing this again and seems to be working correctly now, which is great.
I was wondering if there was a way to show and sort via model number, the same way you can via ID#, price, total etc.?
Thanks.
-
Re: ZC Inventory Report Module
You'd need to customize a few things ...
In the case statement add:
Code:
// bof: add products_model
case('products_model'):
$dir_model = $op_dir;
break;
// eof: add products_model
Code:
<td class="dataTableHeadingContent" align="center"><a href="./stats_inventory_report.php?page=<?php echo $_GET['page']; ?>&sort=cd.categories_name&dir=<?php echo $dir_name; ?>&cat=<?php echo $cat; ?>"><b>Master Category</b></a></td>
<!-- // bof: add products_model -->
<td class="dataTableHeadingContent" align="center"><a href="./stats_inventory_report.php?page=<?php echo $_GET['page']; ?>&sort=products_model&dir=<?php echo $dir_model; ?>&cat=<?php echo $cat; ?>"><b>Model</b></a></td>
<!-- // eof: add products_model -->
<td class="dataTableHeadingContent" align="center"><a href="./stats_inventory_report.php?page=<?php echo $_GET['page']; ?>&sort=products_quantity&dir=<?php echo $dir_quantity; ?>&cat=<?php echo $cat; ?>"><b><?php echo TABLE_HEADING_QUANTITY; ?></b></a></td>
Code:
// bof: add products_model
$products_query_raw = "select p.products_id, products_quantity, pd.products_name, p.products_model, p.products_price, (products_quantity * p.products_price) as total, categories_name from ".TABLE_PRODUCTS." p left join ".TABLE_PRODUCTS_DESCRIPTION." pd using(products_id) LEFT JOIN ".TABLE_CATEGORIES_DESCRIPTION." cd ON(cd.categories_id = p.master_categories_id AND cd.language_id = '$lang_id') $db_category_where group by p.products_id order by $sort $dir";
// eof: add products_model
Code:
<td class="dataTableContent" align="left"><?php echo $products->fields['categories_name']; ?> </td>
<!-- // bof: add products_model -->
<td class="dataTableContent" align="left"><?php echo $products->fields['products_model']; ?> </td>
<!-- // eof: add products_model -->
<td class="dataTableContent" align="center"><?php echo $products->fields['products_quantity']; ?> </td>
Code:
<tr class="dataTableHeadingRow">
<!-- // bof: add products_model -->
<td colspan="6"> </td>
<!-- // bof: add products_model -->
<td class="dataTableHeadingContent" align="right"><?php echo $currencies->format($total); ?></td>
-
Re: ZC Inventory Report Module
Wow, thanks Linda!
It's always appreciated when you go out of your way to help out like that! (Not to take anything away from the addon author, of course.)
I had a go at making the changes to the file myself but I ended up with mismatched table headings and contents. Would it be possible for you to post the entire customized stats_inventory_report.php file?
Thanks :smile:
-
1 Attachment(s)
Re: ZC Inventory Report Module
-
Re: ZC Inventory Report Module
Quote:
Originally Posted by
Ajeh
See if this helps ...
Perfect!
Thank you so much, really appreciate it :smile:
-
Re: ZC Inventory Report Module
You are most welcome ... glad that this is working for you ... :smile:
-
Re: ZC Inventory Report Module
I like this mod,,,, it would be nice if there is a button would say "Print Report" to have a print out on paper is this possible?
-
Re: ZC Inventory Report Module
Hi I do not seem to have this file you are referring to... \my_admin\stats_inventory_report.php on line 160"
Version 1.7 march 20 update
1.5 zc
-
Re: ZC Inventory Report Module
Please see my post regarding the error "Your security clearance does not allow you to access ..." for this plugin: http://www.zen-cart.com/showthread.p...to-access-quot
-
Re: ZC Inventory Report Module
Hi, I have installed this mod, but it does not appear under "Admin", "Tools" despite refreshing. I do have "Sage Configuration" under the "Configuration" menu though.
Any help would be appreciated.
-
Re: ZC Inventory Report Module
Quote:
Originally Posted by
strettonbull
Hi, I have installed this mod, but it does not appear under "Admin", "Tools" despite refreshing. I do have "Sage Configuration" under the "Configuration" menu though.
Any help would be appreciated.
Its not under "Tools" its under "Reports"
-
Re: ZC Inventory Report Module
Quote:
Originally Posted by
morrisgiftshop
Its not under "Tools" its under "Reports"
Doh! How thick am I?
Thanks so much.
-
Re: ZC Inventory Report Module
This is a really useful mod.
My brief was to find away to check stock on the website against actual stock in our warehouse. I spent ages trying to work out how to download stock list to an Excel spreadsheet for cross checking as that was all I could think of.
This report/function is even better than I had hoped in that our website can be immediately updated using a tablet/iPad as the stock is checked on the ground.
Thank you :-)
Natalie
-
Re: ZC Inventory Report Module
Quote:
Originally Posted by
BrightGreen
This is a really useful mod.
My brief was to find away to check stock on the website against actual stock in our warehouse. I spent ages trying to work out how to download stock list to an Excel spreadsheet for cross checking as that was all I could think of.
This report/function is even better than I had hoped in that our website can be immediately updated using a tablet/iPad as the stock is checked on the ground.
Thank you :-)
Natalie
So... is it possible to export the resulting report to a spreadsheet?
-
Re: ZC Inventory Report Module
Quote:
Originally Posted by
jbthomasfl
So... is it possible to export the resulting report to a spreadsheet?
Try copy & paste.. I copied and pasted the full report into an Excel spreadsheet with no issues..
-
Re: ZC Inventory Report Module
Really liking this and appreciate (as usual) ajeh's addition. Hope it will be added to the plug-in release soon.
Just want to suggest two small changes to the stats_inventory_report.php that Linda added above (post 21).
Note: The following line numbers are based on the changed file.
The heading row starts on line 134 and ends on line 148 of the file.
PHP Code:
<tr>
<td colspan="2"><table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr class="dataTableHeadingRow">
<td class="dataTableHeadingContent" align="center"><a href="./stats_inventory_report.php?page=<?php echo $_GET['page']; ?>&sort=p.products_id&dir=<?php echo $dir_id; ?>&cat=<?php echo $cat; ?>"><b><?php echo TABLE_HEADING_NUMBER; ?></b></a></td>
<td class="dataTableHeadingContent"><a href="./stats_inventory_report.php?page=<?php echo $_GET['page']; ?>&sort=products_name&dir=<?php echo $dir_name; ?>&cat=<?php echo $cat; ?>"><b><?php echo TABLE_HEADING_PRODUCTS; ?></b></a></td>
<td class="dataTableHeadingContent" align="center"><a href="./stats_inventory_report.php?page=<?php echo $_GET['page']; ?>&sort=cd.categories_name&dir=<?php echo $dir_name; ?>&cat=<?php echo $cat; ?>"><b>Master Category</b></a></td>
<!-- // bof: add products_model -->
<td class="dataTableHeadingContent" align="center"><a href="./stats_inventory_report.php?page=<?php echo $_GET['page']; ?>&sort=products_model&dir=<?php echo $dir_model; ?>&cat=<?php echo $cat; ?>"><b>Model</b></a></td>
<!-- // eof: add products_model -->
<td class="dataTableHeadingContent" align="center"><a href="./stats_inventory_report.php?page=<?php echo $_GET['page']; ?>&sort=products_quantity&dir=<?php echo $dir_quantity; ?>&cat=<?php echo $cat; ?>"><b><?php echo TABLE_HEADING_QUANTITY; ?></b></a></td>
<td class="dataTableHeadingContent" align="right"><a href="./stats_inventory_report.php?page=<?php echo $_GET['page']; ?>&sort=products_price&dir=<?php echo $dir_price; ?>&cat=<?php echo $cat; ?>"><b><?php echo TABLE_HEADING_PRICE; ?></b></a></td>
<td class="dataTableHeadingContent" align="right"><a href="./stats_inventory_report.php?page=<?php echo $_GET['page']; ?>&sort=total&dir=<?php echo $dir_total; ?>&cat=<?php echo $cat; ?>"><b><?php echo TABLE_HEADING_TOTAL; ?></b></a></td>
</tr>
The outputs for the Master Category and Model are actually left aligned while the titles are centered.
How about this for a little cleaner look?
PHP Code:
<tr>
<td colspan="2"><table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr class="dataTableHeadingRow">
<td class="dataTableHeadingContent" align="center"><a href="./stats_inventory_report.php?page=<?php echo $_GET['page']; ?>&sort=p.products_id&dir=<?php echo $dir_id; ?>&cat=<?php echo $cat; ?>"><b><?php echo TABLE_HEADING_NUMBER; ?></b></a></td>
<td class="dataTableHeadingContent"><a href="./stats_inventory_report.php?page=<?php echo $_GET['page']; ?>&sort=products_name&dir=<?php echo $dir_name; ?>&cat=<?php echo $cat; ?>"><b><?php echo TABLE_HEADING_PRODUCTS; ?></b></a></td>
<td class="dataTableHeadingContent"><a href="./stats_inventory_report.php?page=<?php echo $_GET['page']; ?>&sort=cd.categories_name&dir=<?php echo $dir_name; ?>&cat=<?php echo $cat; ?>"><b>Master Category</b></a></td>
<!-- // bof: add products_model -->
<td class="dataTableHeadingContent"><a href="./stats_inventory_report.php?page=<?php echo $_GET['page']; ?>&sort=products_model&dir=<?php echo $dir_model; ?>&cat=<?php echo $cat; ?>"><b>Model</b></a></td>
<!-- // eof: add products_model -->
<td class="dataTableHeadingContent" align="center"><a href="./stats_inventory_report.php?page=<?php echo $_GET['page']; ?>&sort=products_quantity&dir=<?php echo $dir_quantity; ?>&cat=<?php echo $cat; ?>"><b><?php echo TABLE_HEADING_QUANTITY; ?></b></a></td>
<td class="dataTableHeadingContent" align="right"><a href="./stats_inventory_report.php?page=<?php echo $_GET['page']; ?>&sort=products_price&dir=<?php echo $dir_price; ?>&cat=<?php echo $cat; ?>"><b><?php echo TABLE_HEADING_PRICE; ?></b></a></td>
<td class="dataTableHeadingContent" align="right"><a href="./stats_inventory_report.php?page=<?php echo $_GET['page']; ?>&sort=total&dir=<?php echo $dir_total; ?>&cat=<?php echo $cat; ?>"><b><?php echo TABLE_HEADING_TOTAL; ?></b></a></td>
</tr>
What this does is change the
PHP Code:
<td class="dataTableHeadingContent" align="center">
for both the Master Category and Model to
PHP Code:
<td class="dataTableHeadingContent">
removing the align="center". Don't forget to also remove the space that was in front of the align call.
-
Re: ZC Inventory Report Module
Hi,
Thanks for the required file which gives the report with model number.
But this file has one problem........ The GENERATE CSV FILE link is missing.
Can you please check and rectify the problem and please upload the new file? It will be very much appreciated, as csv download link is a must.
thanks in advance.
muteyaar
-
Re: ZC Inventory Report Module
That is not currently part of the module, it's not missing...........................
-
Re: ZC Inventory Report Module
Quote:
Originally Posted by
mprough
That is not currently part of the module, it's not missing...........................
The CSV DOWNLOAD link is there at the top right of the page when we upload the original files.
But as there is no option of MODEL number, I tried to search and found that Ajeh had given a new file to be replaced in this thread at page number 3.
That file shows the model number very finely, but the CSV FILE DOWNLOAD link (GENERATE CSV) is missing in that case, which is a must have option, because we can only utilize this module properly if we are able to download the csv file of inventory.
I hope you will help me out in this regard.
thank you in advance and waiting for your reply.
- muteyaar
-
Re: ZC Inventory Report Module
Quote:
Originally Posted by
Ajeh
See if this helps ...
Hi,
thanks Ajeh for uploading the new file. This file is really helpful as it displays the Model number of all products. But there is one problem...... The GENERATE CSV link is missing when we upload this file instead of original. Can you please rectify the file so that the csv download link is also there?
I really need this.
thanks in advance.
-- muteyaar
-
Re: ZC Inventory Report Module
I have not looked at this since 2012 ...
I do not know when I will have time to look at it again ...
What version Zen Cart are you using?
-
Re: ZC Inventory Report Module
Quote:
Originally Posted by
Ajeh
I have not looked at this since 2012 ...
I do not know when I will have time to look at it again ...
What version Zen Cart are you using?
I am using zencart version 1.5.4
I will be really thankful to you if you may please look into it and reply soon. i know you are very busy, but I do not have any other source of help except you.
My requirements are as follows:
1. the GENERATE CSV LINK which is missing.
2. the disabled items are also showing in the inventory list. is there any way that the disabled items are not shown or they show zero quantity? I mean, the inventory list should show only the active items quantity. Is it possible?
thanks in advance Ajeh !!
- muteyaar
-
Re: ZC Inventory Report Module
The original file established the $csv on line 50. What to do if $csv ==1 took place at line 95 and continues in lines 110-119 creates $filename for the .csv file.
Line 171 is probably related to the button as it is part of the form.
None of those are found in the file Ajeh submitted.
Wish I had a simple way to reinsert them but, there's a lot going on between old and new. My comparison software is not helping much. AND... Never will my skills match Ajeh.
Hopefully, this info can speed up a solution.
-
Re: ZC Inventory Report Module
Quote:
Originally Posted by
dbltoe
The original file established the $csv on line 50. What to do if $csv ==1 took place at line 95 and continues in lines 110-119 creates $filename for the .csv file.
Line 171 is probably related to the button as it is part of the form.
None of those are found in the file Ajeh submitted.
Wish I had a simple way to reinsert them but, there's a lot going on between old and new. My comparison software is not helping much. AND... Never will my skills match Ajeh.
Hopefully, this info can speed up a solution.
Thanks for your reply dbltoe, I am waiting for a reply from Ajeh also.......
-
1 Attachment(s)
Re: ZC Inventory Report Module
I think this is what you are wanting ... you might ask the author to add this field to future releases ...
This is updated based on v1.8.1
-
Re: ZC Inventory Report Module
Quote:
Originally Posted by
Ajeh
I think this is what you are wanting ... you might ask the author to add this field to future releases ...
This is updated based on v1.8.1
That's Perfect !!
Thank you very much.
There is one more thing that I want in this mod. I do not know if this is possible or not.
I want the CSV file with only the ACTIVE products inventory. This Module is presently showing the whole inventory. there are many INACTIVE PRODUCTS in my store with NON ZERO quantity, and it is very difficult to select these manually.
Is there any method, that I get the desired results with only the ACTIVE products inventory?
Or at least there should be the ACTIVE /INACTIVE status column in the report.
thanks in advance.
-
1 Attachment(s)
Re: ZC Inventory Report Module
Adding a bit more customization should be able to offer you either/or on the CSV file ...
-
Re: ZC Inventory Report Module
Quote:
Originally Posted by
Ajeh
Adding a bit more customization should be able to offer you either/or on the CSV file ...
Thank You Very much Ajeh !!
You are a genius....... I just wanted this exactly same style.
Thanks a lot.
-
Re: ZC Inventory Report Module
You are most welcome ... remember the Zen Cart Team when you are rich and famous! :cool:
-
Re: ZC Inventory Report Module
Quote:
Originally Posted by
Ajeh
You are most welcome ... remember the Zen Cart Team when you are rich and famous! :cool:
Hi,
I have one more question about this mod.
is it possible to receive a column with URL link of main image of each product in the report?
If it is is possible, then kindly help me in this regard.
thanks.
-
Re: ZC Inventory Report Module
Quote:
Originally Posted by
muteyaar
Hi,
I have one more question about this mod.
is it possible to receive a column with URL link of main image of each product in the report?
If it is is possible, then kindly help me in this regard.
thanks.
You would need to add a column, and then use the product_image field to get the image name, then you could create a <a href>, to the images url.
So yes, simple kinda...
-
Re: ZC Inventory Report Module
Quote:
Originally Posted by
bislewl
You would need to add a column, and then use the product_image field to get the image name, then you could create a <a href>, to the images url.
So yes, simple kinda...
Thanks for the quick reply bislewl, i am a layman and do not have much knowledge about this. Can you please give me a step by step process of doing this?
or can you please upload the file with required modification.
I will be very thankful to you.
- muteyaar
-
Re: ZC Inventory Report Module
Quote:
Originally Posted by
muteyaar
Thanks for the quick reply bislewl, i am a layman and do not have much knowledge about this. Can you please give me a step by step process of doing this?
or can you please upload the file with required modification.
I will be very thankful to you.
- muteyaar
Ok, Here is a rough idea. If you don't feel comfortable you may need to hire someone.
Using file-set for version 1.9.0
Line 114: you will need to add p.products_image into the sql select statment
somewhere between 200-210
your's need to add a table header perhaps
HTML Code:
<td class="dataTableHeadingContent" align="center">Image Link</td>
between 235-245 as position as above
you will want to add something like:
PHP Code:
<td class="dataTableContent" align="center"><a href="<?php echo DIR_WS_IMAGES.$products->fields['products_image']; ?>" target="_blank">Link</a></td>
I haven't verified if that works, but that should get you pretty close.
-
Re: ZC Inventory Report Module
Quote:
Originally Posted by
bislewl
Ok, Here is a rough idea. If you don't feel comfortable you may need to hire someone.
Using file-set for version 1.9.0
Line 114: you will need to add p.products_image into the sql select statment
somewhere between 200-210
your's need to add a table header perhaps
HTML Code:
<td class="dataTableHeadingContent" align="center">Image Link</td>
between 235-245 as position as above
you will want to add something like:
PHP Code:
<td class="dataTableContent" align="center"><a href="<?php echo DIR_WS_IMAGES.$products->fields['products_image']; ?>" target="_blank">Link</a></td>
I haven't verified if that works, but that should get you pretty close.
Hi,
I did just as suggested by you.
Now, I am able to see a column in the report with Product image heading and LINK for all the images, but on clicking on the LINK, it shows the XXXXX.com/admin/images page for all the links
Moreover, on downloading the ACTIVE products report, the products image column in present, but it does not show any link. it has blank values.
-
Re: ZC Inventory Report Module
Quote:
Originally Posted by
muteyaar
Hi,
I did just as suggested by you.
Now, I am able to see a column in the report with Product image heading and LINK for all the images, but on clicking on the LINK, it shows the XXXXX.com/admin/images page for all the links
Moreover, on downloading the ACTIVE products report, the products image column in present, but it does not show any link. it has blank values.
is it pulling in the product_images? If not is the product images in the select statement?
it should look like:
PHP Code:
$products_query_raw = "select p.products_id, products_quantity, pd.products_name, p.products_model, p.products_price, (products_quantity * p.products_price) as total, categories_name, p.products_quantity_order_min, m.manufacturers_name, p.products_image from " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_DESCRIPTION . " pd using(products_id) LEFT JOIN " . TABLE_CATEGORIES_DESCRIPTION . " cd ON(cd.categories_id = p.master_categories_id AND cd.language_id = '" . $lang_id . "') left join " . TABLE_MANUFACTURERS . " m using(manufacturers_id) " . $db_category_where . " group by p.products_id order by " . $sort . " " . $dir;
try using this line instead
PHP Code:
<td class="dataTableContent" align="center"><a href="<?php echo DIR_WS_CATALOG_IMAGES.$products->fields['products_image']; ?>" target="_blank">Link</a></td>
That should resolve the /admin issue
-
Re: ZC Inventory Report Module
Quote:
Originally Posted by
bislewl
is it pulling in the product_images? If not is the product images in the select statement?
it should look like:
PHP Code:
$products_query_raw = "select p.products_id, products_quantity, pd.products_name, p.products_model, p.products_price, (products_quantity * p.products_price) as total, categories_name, p.products_quantity_order_min, m.manufacturers_name, p.products_image from " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_DESCRIPTION . " pd using(products_id) LEFT JOIN " . TABLE_CATEGORIES_DESCRIPTION . " cd ON(cd.categories_id = p.master_categories_id AND cd.language_id = '" . $lang_id . "') left join " . TABLE_MANUFACTURERS . " m using(manufacturers_id) " . $db_category_where . " group by p.products_id order by " . $sort . " " . $dir;
try using this line instead
PHP Code:
<td class="dataTableContent" align="center"><a href="<?php echo DIR_WS_CATALOG_IMAGES.$products->fields['products_image']; ?>" target="_blank">Link</a></td>
That should resolve the /admin issue
Hi, thanks for the quick reply.
I added the code given by you .
It is now showing the links for product images in the ADMIN panel. But when I down load the ACTIVE products report, the product images column has BLANK values.. Nothing shows there.
-
Re: ZC Inventory Report Module
Quote:
Originally Posted by
muteyaar
Hi, thanks for the quick reply.
I added the code given by you .
It is now showing the links for product images in the ADMIN panel. But when I down load the ACTIVE products report, the product images column has BLANK values.. Nothing shows there.
ok, if you want it in the CSV as well try changing this around line 118
PHP Code:
$products[] = array(
'products_id' => $current_inventory->fields['products_id'],
'products_model' => $current_inventory->fields['products_model'],
'products_name' => $current_inventory->fields['products_name'],
'categories_name' => $current_inventory->fields['categories_name'],
'manufacturers_name' => $current_inventory->fields['manufacturers_name'],
'products_quantity' => $current_inventory->fields['products_quantity'],
'products_quantity_order_min' => $current_inventory->fields['products_quantity_order_min'],
'products_price' => $currencies->format($current_inventory->fields['products_price']),
'total' => $currencies->format($current_inventory->fields['total']),
);
to:
PHP Code:
$products[] = array(
'products_id' => $current_inventory->fields['products_id'],
'products_model' => $current_inventory->fields['products_model'],
'products_name' => $current_inventory->fields['products_name'],
'products_image' => DIR_WS_CATALOG_IMAGES.$current_inventory->fields['products_image'],
'categories_name' => $current_inventory->fields['categories_name'],
'manufacturers_name' => $current_inventory->fields['manufacturers_name'],
'products_quantity' => $current_inventory->fields['products_quantity'],
'products_quantity_order_min' => $current_inventory->fields['products_quantity_order_min'],
'products_price' => $currencies->format($current_inventory->fields['products_price']),
'total' => $currencies->format($current_inventory->fields['total']),
);
-
Re: ZC Inventory Report Module
Quote:
Originally Posted by
bislewl
ok, if you want it in the CSV as well try changing this around line 118
PHP Code:
$products[] = array(
'products_id' => $current_inventory->fields['products_id'],
'products_model' => $current_inventory->fields['products_model'],
'products_name' => $current_inventory->fields['products_name'],
'categories_name' => $current_inventory->fields['categories_name'],
'manufacturers_name' => $current_inventory->fields['manufacturers_name'],
'products_quantity' => $current_inventory->fields['products_quantity'],
'products_quantity_order_min' => $current_inventory->fields['products_quantity_order_min'],
'products_price' => $currencies->format($current_inventory->fields['products_price']),
'total' => $currencies->format($current_inventory->fields['total']),
);
to:
PHP Code:
$products[] = array(
'products_id' => $current_inventory->fields['products_id'],
'products_model' => $current_inventory->fields['products_model'],
'products_name' => $current_inventory->fields['products_name'],
'products_image' => DIR_WS_CATALOG_IMAGES.$current_inventory->fields['products_image'],
'categories_name' => $current_inventory->fields['categories_name'],
'manufacturers_name' => $current_inventory->fields['manufacturers_name'],
'products_quantity' => $current_inventory->fields['products_quantity'],
'products_quantity_order_min' => $current_inventory->fields['products_quantity_order_min'],
'products_price' => $currencies->format($current_inventory->fields['products_price']),
'total' => $currencies->format($current_inventory->fields['total']),
);
It is now showing only one URL in all the fields on the products images column in the CSV file
http://XXXXXX.com/images
it is still not showing proper URLs of each products
-
Re: ZC Inventory Report Module
Quote:
Originally Posted by
muteyaar
It is now showing only one URL in all the fields on the products images column in the CSV file
http://XXXXXX.com/images
it is still not showing proper URLs of each products
I should be showing the complete url, as long as the product has an image.
Is your spreadsheet software hiding the rest? It's the only thing I can think of right now
-
Re: ZC Inventory Report Module
Quote:
Originally Posted by
bislewl
I should be showing the complete url, as long as the product has an image.
Is your spreadsheet software hiding the rest? It's the only thing I can think of right now
Here are the screenshots of what I am getting:
admin panel: http://i140.photobucket.com/albums/r...nvrepadmin.png
CSV file: http://i140.photobucket.com/albums/r.../activerep.png
The links are fine in admin panel, but the URLs are incomplete in the CSV file.
-
Re: ZC Inventory Report Module
Quote:
Originally Posted by
muteyaar
Hi,
Thanks for your help Zencart team,
I managed to get the desired report by changing
$lang_id = $_SESSION['languages_id'] != '' ? intval($_SESSION['languages_id']) : 1;
$products_query_raw = "select p.products_id, products_quantity, pd.products_name, p.products_model, p.products_price, (products_quantity * p.products_price) as total, categories_name, p.products_quantity_order_min, m.manufacturers_name from " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_DESCRIPTION . " pd using(products_id) LEFT JOIN " . TABLE_CATEGORIES_DESCRIPTION . " cd ON(cd.categories_id = p.master_categories_id AND cd.language_id = '" . $lang_id . "') left join " . TABLE_MANUFACTURERS . " m using(manufacturers_id) " . $db_category_where . " group by p.products_id order by " . $sort . " " . $dir;
//echo 'sql: ' . $products_query_raw . '<br>';
if ($csv == '1') {
to this:
$lang_id = $_SESSION['languages_id'] != '' ? intval($_SESSION['languages_id']) : 1;
$products_query_raw = "select p.products_id, products_quantity, pd.products_name, p.products_model, p.products_image, p.products_price, (products_quantity * p.products_price) as total, categories_name, p.products_quantity_order_min, m.manufacturers_name from " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_DESCRIPTION . " pd using(products_id) LEFT JOIN " . TABLE_CATEGORIES_DESCRIPTION . " cd ON(cd.categories_id = p.master_categories_id AND cd.language_id = '" . $lang_id . "') left join " . TABLE_MANUFACTURERS . " m using(manufacturers_id) " . $db_category_where . " group by p.products_id order by " . $sort . " " . $dir;
//echo 'sql: ' . $products_query_raw . '<br>';
if ($csv == '1') {
CSV file is now giving correct reporting.
Thanks !!
-
Re: ZC Inventory Report Module
Hi,
I am brand new to zen cart, and a 'pigeon' programmer, so please understand that I while I can understand concepts, I have to nut it out with the programming by turning each cog in my brain individually ......
Having scoured the forums and net for answers, I don't think this has been covered, relating to this module (please correct me if I'm wrong)
I am almost entirely happy withe my store, and am populating, however have a little bug with this particular add-on relating to 'report by category' from the drop down menu:
When running this report from 'top' category, everything works well (very, very well .... Exactly what I was after - thank you to author).
However, when I select a category or subcategory, I receive the 'warning, an error occurred, please refresh, etc', and the list does not populate.
I have looked at the myAdminDebug files, with the following result: (nb: ****** in place of store and admin names)
[04-Feb-2016 14:52:43 UTC] PHP Warning: explode() expects parameter 2 to be string, array given in /home/******/public_html/store/******/stats_inventory_report.php on line 73
[04-Feb-2016 14:52:43 UTC] PHP Fatal error: 1064:You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 1 :: select count(*) as total from zc_products p left join zc_products_description pd using(products_id) LEFT JOIN zc_categories_description cd ON(cd.categories_id = p.master_categories_id AND cd.language_id = '1') left join zc_manufacturers m using(manufacturers_id) WHERE ==> (as called by) /home/******/public_html/store/******/includes/classes/split_page_results.php on line 39 <== in /home/******/public_html/store/includes/classes/db/mysql/query_factory.php on line 155
From what I can conclude, it appears that I have two errors occurring, however the second is possibly related to / resulting from the first.
My 'pigeon' interprets the first as a problem with the variable being returned: the request is asking for a string, but receiving an array .... sound right?
Any ideas on how I might resolve this? Either way, this add-on is going to be very useful, however I have around 2,000 items to manage. It would be much more handy if I could break this report down by category.
Thank you for taking the time to read - I hope someone will be able to assist, however it isn't a 'show stopper' for me, by any means.
Using: ZC 1.5.4, downloaded plug-in about a week ago.
PHP Version: 5.3.29 (Zend: 2.3.0) PHP Memory Limit: 128M
Database: MySQL 10.0.20-MariaDB-cll-lve
I do have quite a few other add-ons in place - this was one of the earlier installs, and has given the same result since installation.
NB. I do not have any manufacturers specified, however did test adding a manufacturer to a product, with the same result. Don't think this should affect category level reporting, but perhaps?
Regards,
Tim Bowden
TDK APDC
-
Re: ZC Inventory Report Module
I believe that your 'pigeon' interpretation of the issue is close. The problem appears to be that the script is calling the PHP function explode and supplying an array for the 2nd argument instead of a string. Fix that issue and the sQL error will resolve itself.
What is the block of code around line 73 of the stats_inventory_report script? You can use the "CODE" tags (the # in the toolbar you see when you're creating a post) to wrap the code-block.
Although it's not going to shed additional light on this error, you might want to install the myDEBUG Backtrace (https://www.zen-cart.com/downloads.php?do=file&id=1879) plugin to help in solving future issues.
-
Re: ZC Inventory Report Module
Hi lat9,
Thanks for taking an interest, and I will download and start using myDebug backtrace plugin.
the code preceding, and including line 73 is as follows:
Code:
$where_array = array();
if ($cat != '') {
$where_array[] = " master_categories_id = '".$cat."' ";
}
if ($status != ''){
$where_array[] = " products_status = '".$status."' ";
}
if ($mfg != ''){
$where_array[] = " manufacturers_id = '".$mfg."' ";
}
if(count($where_array) > 0){
$db_category_where = " WHERE ".explode(" AND ", $where_array);
}
else{
$db_category_where = '';
}
Line 73 is
Code:
$db_category_where = " WHERE ".explode(" AND ", $where_array);
near the bottom.
I can see a reference to manufacturer above, which is what led me to try adding a manufacturer to one of my products, to see if it made a difference.
Appreciate your input / thoughts.
Tim
TDK APDC
-
Re: ZC Inventory Report Module
Oh, I see now, it's a coding issue in the original script (I've got no idea how it ever ran properly). The 'and' clauses are being built up into an array and then want to be stringified for use in the SQL query.
The correct PHP function to use is implode, like this:
Code:
$db_category_where = " WHERE ".implode(" AND ", $where_array);
-
Re: ZC Inventory Report Module
Nice work,
Hit the nail right on the head, and is now working perfectly.
Thank you very much for your assistance.
It has made a useful tool in to an extremely useful tool for me.
Much appreciated.
Tim Bowden
TDK APDC
-
Re: ZC Inventory Report Module
Tim, thanks for the follow-up; I'm glad to have helped.
... and ... welcome to the Zen Cart community!
-
Re: ZC Inventory Report Module
2020 Update - Inventory Report drops right into Zen Cart 1.55f and 1.56c if anyone needs it :)
It has also been integrated into the Twitch Base6 public release.
-
Re: ZC Inventory Report Module
Hello,
the plugin is exactly what I need.
Is it possible to display only active products?
I have over a thousand of inactive products which I keep for backup only. I don't want them been counted.
-
Twitch Inventory Report Advanced
Submitted to plugins...
Twitch Inventory Report Advanced
22a for Zen Cart 1.57c
May 11.2022
Added Twitch Admin Product Thumbnails (TAP Thumb) to Inventory Report Module v1.9.2 with Twitch Base7 image control switches all working together. This printable inventory report can be used to quickly check images, print visual inventory audit lists and more.
Inventory report tested on Zen Cart 1.57c to display or hide images with the newest TAP Thumb image checker - works if you do not have Twitch TAP Thumb installed.
-
Re: Twitch Inventory Report Advanced
Twitch, could I get you to resubmit your plugin as a brand new plugin? I just realized you've changed the filenames and a bunch of other things, and it would make more sense to have a separate download and support thread for your mod.
-
Re: Twitch Inventory Report Advanced
Quote:
Originally Posted by
swguy
Twitch, could I get you to resubmit your plugin as a brand new plugin? I just realized you've changed the filenames and a bunch of other things, and it would make more sense to have a separate download and support thread for your mod.
There is no need to continue branching good modules, this is an improvement on the old module just like any other. The added features can all be turned on/off - as you could easily upgrade and choose to use them or not.
-
Re: Twitch Inventory Report Advanced
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.
-
Re: Twitch Inventory Report Advanced
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
-
Re: Twitch Inventory Report Advanced
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?
-
1 Attachment(s)
Re: Twitch Inventory Report Advanced
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
-
Re: Twitch Inventory Report Advanced
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