Forums / Addon Admin Tools / Inventory Updater...

Inventory Updater...

Results 1 to 20 of 81
02 Jun 2020, 01:18
#1
carlwhat avatar

carlwhat

Totally Zenned

Join Date:
Nov 2005
Posts:
2,932
Plugin Contributions:
5

Inventory Updater...

this is the support thread for the new inventory updater. it can be downloaded here:

https://www.zen-cart.com/downloads.php?do=file&id=2279

it allows for updating of inventory quantities on a single admin page for all items in a category. in addition, it also allows admins to disable or re-enable products right from that page. editing of an item can also be accessed by clicking directly on the item name.

it has been tested for use with ZC v1.5.6 and v1.5.7 only. v1.5.6 has an additional file that you need to upload to your store. instructions are provided.

no ZC core files are modified! no additional ZC fields or tables. if you want to have access to the page from an admin menu, additional instructions are provided!

support is here.
02 Jun 2020, 18:49
#2
gernot avatar

gernot

Zen Follower

Join Date:
Feb 2017
Posts:
334
Plugin Contributions:
0

Re: Inventory Updater...

That's a very convenient plugin, and nice design too to not modify any core files or tables (using all those nifty notifiers I guess).
02 Jun 2020, 20:49
#3
carlwhat avatar

carlwhat

Totally Zenned

Join Date:
Nov 2005
Posts:
2,932
Plugin Contributions:
5

Re: Inventory Updater...

gernot:

That's a very convenient plugin, and nice design too to not modify any core files or tables (using all those nifty notifiers I guess).


thank you for that! i'm glad you find it useful. :smile:

as this plugin is a new page, it does not make use of any notifiers. it does make use of the existing ZC infrastructure, so it has the same look and feel.

i was thinking about adding another field for potential updating from this page; perhaps the base price. i was also thinking about adding a search field; so one could search for something, and then update the results. for example, if one had a lot of inventory from a specific manufacturer, you could search for that manufacturer and then update the inventory for those search results.

its a convenient way if one has to update inventory after taking a physical or spot check or perhaps after purchasing new stock without having to dig into each item individually.
05 Jun 2020, 16:32
#4
gernot avatar

gernot

Zen Follower

Join Date:
Feb 2017
Posts:
334
Plugin Contributions:
0

Re: Inventory Updater...

Hi,
I saw this and installed and used it the same day, heh. It certainly makes life easier (since we sell products outside of Zen Cart).
I was pleasantly surprised how clean the page is, good to hear the explanation.

Updating the price would be a great help, adjusting quantities and prices en masse are both common operations.
Regarding search, I am lucky I categorized by manufacturer, so I just select that manufacturer to get the list I want.
I suppose for abstract categories a search would indeed be useful (maybe other attributes too if you are about it).

Something that might be cool would be the ability to change the model and product name directly too. I don't know how useful/risky this would be, most times a change in say the vintage of a wine also means changing the content of the product description too. But it still makes correcting various errors easier (especially when mixing languages like on my site). Note that I am not complaining, since you can click on the product and go straight to its editing page already.

As you say, perfect for stock updates, it matches my needs perfectly, so very much appreciated.
06 Jun 2020, 10:56
#5
simon1066 avatar

simon1066

Totally Zenned

Join Date:
Feb 2009
Posts:
1,326
Plugin Contributions:
0

Re: Inventory Updater...

I too find this useful, thank you.

I added a product image column as this helps with managing the inventory of greeting cards.
06 Jun 2020, 14:23
#6
carlwhat avatar

carlwhat

Totally Zenned

Join Date:
Nov 2005
Posts:
2,932
Plugin Contributions:
5

Re: Inventory Updater...

simon1066:

I too find this useful, thank you.

I added a product image column as this helps with managing the inventory of greeting cards.


:thumbsup:
14 Jun 2020, 06:47
#7
jcrennan avatar

jcrennan

New Zenner

Join Date:
Mar 2012
Posts:
12
Plugin Contributions:
0

Re: Inventory Updater...

This looks great and what I have been looking for, my only feedback would be the category list, I have a large list of categories and sub categories and some sub sub categories. The list order in the dropdown can make it hard to find the category that I am looking, is there any way that it could be placed into the store category order?
14 Jun 2020, 10:28
#8
simon1066 avatar

simon1066

Totally Zenned

Join Date:
Feb 2009
Posts:
1,326
Plugin Contributions:
0

Re: Inventory Updater...

jcrennan:

This looks great and what I have been looking for, my only feedback would be the category list, I have a large list of categories and sub categories and some sub sub categories. The list order in the dropdown can make it hard to find the category that I am looking, is there any way that it could be placed into the store category order?


Yes, ideally incorporating the category structure from the dropdown on admin/category_product_listing.php, which uses this code:
echo zen_draw_pull_down_menu('cPath', zen_get_category_tree(), $current_category_id, 'onchange="this.form.submit();" class="form-control"');


I had a look but the code changes required are a bit beyond me.
14 Jun 2020, 11:35
#9
carlwhat avatar

carlwhat

Totally Zenned

Join Date:
Nov 2005
Posts:
2,932
Plugin Contributions:
5

Re: Inventory Updater...

i can certainly take a look at that when i have a moment.

best.
14 Jun 2020, 15:44
#10
carlwhat avatar

carlwhat

Totally Zenned

Join Date:
Nov 2005
Posts:
2,932
Plugin Contributions:
5

Re: Inventory Updater...

jcrennan:

This looks great and what I have been looking for, my only feedback would be the category list, I have a large list of categories and sub categories and some sub sub categories. The list order in the dropdown can make it hard to find the category that I am looking, is there any way that it could be placed into the store category order?


i see what you are talking about... it's a good point, and worth addressing in a new release....

simon1066:

Yes, ideally incorporating the category structure from the dropdown on admin/category_product_listing.php, which uses this code:
echo zen_draw_pull_down_menu('cPath', zen_get_category_tree(), $current_category_id, 'onchange="this.form.submit();" class="form-control"');


I had a look but the code changes required are a bit beyond me.


:laugh: if it only involved that code. sub sub categories will take some thinking about how best to do this....
15 Jun 2020, 17:02
#11
carlwhat avatar

carlwhat

Totally Zenned

Join Date:
Nov 2005
Posts:
2,932
Plugin Contributions:
5

Re: Inventory Updater...

ok, a new version has been submitted for approval.

thanks to both @jcrennan and @simon1066 for pointing out the problem and the proposed fix.

hope you find the new version more useful. i did incorporate a small change so that one can see all products in sub-categories of a particular category. you can always select the sub-category to see only those products. sub-sub categories require selecting that category, or 1 level above. hopefully once approved, and you play with the changes you will see what i mean.

best.
16 Jun 2020, 00:12
#12
carlwhat avatar

carlwhat

Totally Zenned

Join Date:
Nov 2005
Posts:
2,932
Plugin Contributions:
5

Re: Inventory Updater...

new version is now available here:

https://www.zen-cart.com/downloads.php?do=file&id=2279

makes better use of the ZC category tree structure.

constructive critiques are always welcome.

best.
01 Jul 2020, 07:14
#13
dianeg avatar

dianeg

New Zenner

Join Date:
Apr 2019
Posts:
4
Plugin Contributions:
0

Re: Inventory Updater...

carlwhat:

thank you for that! i'm glad you find it useful. :smile:

as this plugin is a new page, it does not make use of any notifiers. it does make use of the existing ZC infrastructure, so it has the same look and feel.

i was thinking about adding another field for potential updating from this page; perhaps the base price. i was also thinking about adding a search field; so one could search for something, and then update the results. for example, if one had a lot of inventory from a specific manufacturer, you could search for that manufacturer and then update the inventory for those search results.

its a convenient way if one has to update inventory after taking a physical or spot check or perhaps after purchasing new stock without having to dig into each item individually.


I've been waiting for someone to write a module like this. Thankyou.
A field for updating the base price would be very useful.
03 Jul 2020, 16:57
#14
carlwhat avatar

carlwhat

Totally Zenned

Join Date:
Nov 2005
Posts:
2,932
Plugin Contributions:
5

Re: Inventory Updater...

version 1.2.0 has been submitted. i will post when approved and ready for download.

due to popular demand, base price can now be updated!

there is also some additional error checking so that item updated counts are more accurate.

@gernot, i gave some serious thought to changing models as well as product name; i thought about adding a selector so that an admin can select a field that they want to update. but i chose to not implement these things. as someone who has implemented a number of wine sites, i am of the firm opinion that a new vintage is a new product. and that vintage should be stored as a separate field in your database. perhaps vintage is not as crucial for the wines you sell; but i find it hard to go against my beliefs!

i will post when the new version is ready to download. all feedback is appreciated.

best.
03 Jul 2020, 17:25
#15
simon1066 avatar

simon1066

Totally Zenned

Join Date:
Feb 2009
Posts:
1,326
Plugin Contributions:
0

Re: Inventory Updater...

I haven't tried v1.2.0 but one issue I'm having on the previous version is that after adding the Inventory admin page to a user profile other than Superuser, I get

...your security clearance does not allow you to access this resource.

I thought it might be related to the Admin Page Registration, not knowing much about the process I attempted different page key and menu choice but still the same error. Perhaps something in the code.

Edit: ZC v1.56c, plus plenty of mods which I probably should have listed.
03 Jul 2020, 17:51
#16
simon1066 avatar

simon1066

Totally Zenned

Join Date:
Feb 2009
Posts:
1,326
Plugin Contributions:
0

Re: Inventory Updater...

simon1066:

I haven't tried v1.2.0 but one issue I'm having on the previous version is that after adding the Inventory admin page to a user profile other than Superuser, I get

...your security clearance does not allow you to access this resource.

I thought it might be related to the Admin Page Registration, not knowing much about the process I attempted different page key and menu choice but still the same error. Perhaps something in the code.

Edit: ZC v1.56c, plus plenty of mods which I probably should have listed.


Found the answer, https://www.zen-cart.com/showthread.php?197061-Customer-Uploaded-Files-Plugin-Sorry-your-security-clearance-does-not-allow-you&p=1131197#post1131197

admin/includes/extra_datafiles/inventory.php

define('FILENAME_INVENTORY', 'inventory.php');


to

define('FILENAME_INVENTORY', 'inventory');
03 Jul 2020, 18:59
#17
carlwhat avatar

carlwhat

Totally Zenned

Join Date:
Nov 2005
Posts:
2,932
Plugin Contributions:
5

Re: Inventory Updater...

simon1066:

Found the answer, https://www.zen-cart.com/showthread.php?197061-Customer-Uploaded-Files-Plugin-Sorry-your-security-clearance-does-not-allow-you&p=1131197#post1131197

admin/includes/extra_datafiles/inventory.php

define('FILENAME_INVENTORY', 'inventory.php');


to

define('FILENAME_INVENTORY', 'inventory');


man, what a bloody waste!

the idea that back in 2013, we had this error, and it was supposed to be corrected back then, and the correction does not fix the problem..... wow.

i digress....

your solution does work. the core ZC should have taken care of my error, but alas it does not....

feel free to implement that. i will do another submit shortly. as well as fix the base zen code. i hope.

thanks for pointing this out.

best.
03 Jul 2020, 19:54
#18
carlwhat avatar

carlwhat

Totally Zenned

Join Date:
Nov 2005
Posts:
2,932
Plugin Contributions:
5

Re: Inventory Updater...

@simon1066, version 1.2.1 removes the .php from the filename.

in addition, hopefully the ZC team will merge this PR that actually does fix this issue for other plugin authors like myself that make the same mistake:

https://github.com/zencart/zencart/pull/3653

best.
04 Jul 2020, 16:07
#19
carlwhat avatar

carlwhat

Totally Zenned

Join Date:
Nov 2005
Posts:
2,932
Plugin Contributions:
5

Re: Inventory Updater...

version 1.2.1 now available for download here:

https://www.zen-cart.com/downloads.php?do=file&id=2279

update base price as well as inventory!

also, no modifications necessary to work within admin profile security.

best.
08 Jul 2020, 10:24
#20
simon1066 avatar

simon1066

Totally Zenned

Join Date:
Feb 2009
Posts:
1,326
Plugin Contributions:
0

Re: Inventory Updater...

Inventory Updater v1.2.1
PHP v7.2.10

Upgrading to ZCv1.57, I get these myDEBUG logs notices when viewing the Inventory Updater page - I know the notices are not critical but if I don't address these undefined index notices (and many others unrelated to Inventory Updater, across the site) the number of log files will become unmanageable.

[08-Jul-2020 10:59:08 Europe/London] PHP Notice:  Undefined index: sort in D:\wamp64\www\mydomain.co.uk\myadmin\inventory.php on line 73
[08-Jul-2020 10:59:08 Europe/London] PHP Stack trace:
[08-Jul-2020 10:59:08 Europe/London] PHP   1. {main}() D:\wamp64\www\mydomain.co.uk\myadmin\index.php:0
[08-Jul-2020 10:59:08 Europe/London] PHP   2. require() D:\wamp64\www\mydomain.co.uk\myadmin\index.php:11
[08-Jul-2020 10:59:08 Europe/London] PHP Notice:  Undefined index: sort in D:\wamp64\www\mydomain.co.uk\myadmin\inventory.php on line 285
[08-Jul-2020 10:59:08 Europe/London] PHP Stack trace:
[08-Jul-2020 10:59:08 Europe/London] PHP   1. {main}() D:\wamp64\www\mydomain.co.uk\myadmin\index.php:0
[08-Jul-2020 10:59:08 Europe/London] PHP   2. require() D:\wamp64\www\mydomain.co.uk\myadmin\index.php:11

... followed by a line 285 entry for every product listed.


inventory.php line 71-76
$sort = (isset($_GET['sort']) ? $_GET['sort'] : '0');
	$order_by = " ";
	switch ($_GET['sort']) {
		case (0):
			$order_by = " ORDER BY p.products_sort_order, pd.products_name";
			break;


inventory.php line 284-286
 <a href="<?= zen_href_link(FILENAME_INVENTORY,
        'action=tg_stat' . '&pid=' . $prod_list->fields['products_id'] . $cid_params . '&sort=' . $_GET['sort'] . '&active=' . $_GET['active'],
        'SSL'); ?>">


'PHP Notice: Undefined index:' seems to be a bit of a theme with my upgrade to ZCv1.57 - seems to be mainly caused by old mods and my crude hacking of php files, still trying to get my head around the whys and wherefores.