I figured out something that might come in handy to fellow Zenners. This is my first contribute and I will warn you I am not a coder or webdesigner (hobby). However I am good at trying to copy ways zencart currently works and can sometimes figure things out. So beware I may have done some things incorrectly. I am trying to help out the community since I have recieved help numerous times. Thank you
My current setup 1.5.1 Zencart with 3 custom fields added for Minimum stock level, Maximum stock level to order, Vendor to order from. I used the numinix mod and copied how he did it to add additional fields. What the below does is add a seperate page to zencart like categories.php that you click on to display all products in admin. I basically copy that page and make it my own categories_min.php to be used for determining what I need to order that we have low stock on. It allows me to search by vendor and display all products from that vendor that are only low on stock.
Based on this post of someone helping me out is how to configure search in custom fields for products data under admin/categories.php.
admin/includes/modules/category_product_listing.php
Add your_sku_db_field name to the $products_query_raw list
Then add a filter at the bottom that reads:
or p.products_YOUR_SKU_FIELD_HERE like '%" . zen_db_input($_GET['search']) . "%'
See this post where a fellow zenner helped to figure this out.
To add something else I just did that might come in handy for some others. Is a way for you to visually see a low stock count for products when searching a field and then display a list of products based on that search. As well as compare values for actual inventory verses an additional custom field you must add for your minimum stock level before needing to reorder products.
Also figured out that the section before the “or statements” that you can change the “and statements” to also filter by fields. This will display a listing of only products that need to be reordered. The next line is two statements that I tried out and worked use one or other depending on what you prefer to display in regards to your custom fields used.
and p.products_quantity < p.products_minstock or and p.products_quantity < ((p.products_maxstock - p.products_minstock ) / 2) + p.products_minmaxjp (Custom added field for my minimum stock count). What I did was the following incase someone else needs this.
1) I copied admin\categories.php and renamed to categories_min.php
2) I copied admin\includes\languages\english\categories.php and renamed the copy to categories_min.php
3) Go to next step
4) I copied includes\functions\functions_categories.php and renamed the copy to functions_categories_min.php
5) Open includes\filenames.php and add the following line define('FILENAME_CATEGORIES_MIN', 'categories_min');
6) I copied admin\includes\modules\category_product_listing.php and renamed the copy to category_product_listing_min.php
7) in file category_product_listing_min.php do find and replace for FILENAME_CATEGORIES in this file only and replace with FILENAME_CATEGORIES_MIN (this will allow the same page to load up categories_min.php after searches and dropdown menu changes.
8) add a row the following code in the header of the categories_min.php page
Code:
<td class="smallText" align="center" width="150" valign="top"><?php echo TEXT_LEGEND_META_TAGS . '<br />' . TEXT_YES . ' ' . TEXT_NO . '<br />' . zen_image(DIR_WS_IMAGES . 'icon_edit_metatags_on.gif', ICON_METATAGS_ON) . ' ' . zen_image(DIR_WS_IMAGES . 'icon_edit_metatags_off.gif', ICON_METATAGS_OFF); ?></td>
</tr>
</table></td>
</tr>
<!--JP Added to change header for easy changing --><tr> <td><table><tr> <td><p><b> <u><font color="red" size="4">THIS DISPLAYS LOW STOCK FOR VENDOR SEARCHED ONLY. <br> <a href="https:// website.com /admin/categories.php"----->>>>>>> CLICK HERE FOR NORMAL CATEGORIES PAGE (Store Default)</a></font></u></b></p> </u></td><td width="200"><u><b>Quick Search</b></u><br> <a href="https:// website.com /admin/categories_min.php?search=hybec">Hybec</a> <br>
<a href="https://website.com/admin/categories_min.php?search=text1">Searched text1</a><br>
<a href="https:// website.com /admin/categories_min.php?search= text2"> Searched text2</a><br>
<a href="https:// website.com /admin/categories_min.php?search= text3"> Searched text3</a><br>
<a href="https:// website.com /admin/categories_min.php?search= text4"> Searched text4</a><br>
<a href="https:// website.com /admin/categories_min.php?search= text5"> Searched text5</a><br>
<a href="https:// website.com /admin/categories_min.php?search= text6"> Searched text6</a><br>
<a href="https:// website.com /admin/categories_min.php?search= text7"> Searched text17</a><br>
</td><td> <b> <FONT
style="BACKGROUND-COLOR: yellow"><u>How to use this page! (don't worry about CAPS) </u></b> <br>1) To Find all products with low stock </u></b> - Press "Spacebar" then press "Enter" in Searchbox <br>2) Type text for vendor or better yet part of vendor name to make sure it comes up if its not spelled right. Example All world, might be together or apart. Instead search "Wor". Its unique and odds are no other words will come up with it. <br> 3) Use drop down categories to look in each folder for low stock items. <br><br>***FORMULA USED TO DISPLAY LOW INVENTORY = This p.products_quantity < p.min_stock or if you want to change for cushion try this but required both MIN Max stock custom fields. If Actual Stock QTY < ((MAX-MIN stock) / 2) + MIN stock.
</FONT></td></tr></table></td>
<tr><!--JP Added -->
9) Change the following code in the the categories.php page to add to header to change back and forth in pages easily
Code:
<td class="smallText" align="center" width="150" valign="top"><?php echo TEXT_LEGEND_META_TAGS . '<br />' . TEXT_YES . ' ' . TEXT_NO . '<br />' . zen_image(DIR_WS_IMAGES . 'icon_edit_metatags_on.gif', ICON_METATAGS_ON) . ' ' . zen_image(DIR_WS_IMAGES . 'icon_edit_metatags_off.gif', ICON_METATAGS_OFF); ?></td> <!--JP Added --><td>
<u> <a href="https://website.com/admin/categories_min.php">***CLICK HERE TO SEARCH VENDOR FOR OTHER ITEMS WE MAY BE LOW ON STOCK FOR RE-ORDER***</a></u></td><tr><!--JP Added -->
Hope this helps someone in figuring out how to do this or do something else. Cheers!
Bookmarks