Results 1 to 4 of 4
  1. #1

    Default Minimum and Maximum stock count and displaying products in list based on criteria

    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 . '&nbsp;' . TEXT_NO . '<br />' . zen_image(DIR_WS_IMAGES . 'icon_edit_metatags_on.gif', ICON_METATAGS_ON) . '&nbsp;' . 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 &lt; ((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 . '&nbsp;' . TEXT_NO . '<br />' . zen_image(DIR_WS_IMAGES . 'icon_edit_metatags_on.gif', ICON_METATAGS_ON) . '&nbsp;' . 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!

  2. #2
    Join Date
    Apr 2007
    Location
    Ontario, Canada
    Posts
    1,731
    Plugin Contributions
    27

    Default Re: Minimum and Maximum stock count and displaying products in list based on criteria

    Can you publish a screenshot of the output? I get it, I really want to see it in action :)
    Twitch.
    https://www.twitchtoo.com Do you work for free? Please donate.
    Twitch Base8 - Obsidian - This, is what's new.

  3. #3

    Default Re: Minimum and Maximum stock count and displaying products in list based on criteria

    Quote Originally Posted by twitchtoo View Post
    Can you publish a screenshot of the output? I get it, I really want to see it in action :)
    See attached- I showed that the low stock items only displayed with the drop down menu but search feature works fine as well by typing in the box or by clicking one of the quick search links I added for my most common searches. I changed quick search links for vendors to store names most people would recognize for sake of explanation in regards to searching for vendor names.
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	Example item list in folder.jpg 
Views:	111 
Size:	45.4 KB 
ID:	13482   Click image for larger version. 

Name:	Example low count item list when using drop down.jpg 
Views:	100 
Size:	64.9 KB 
ID:	13483   Click image for larger version. 

Name:	Low stock page copy with url.jpg 
Views:	115 
Size:	70.5 KB 
ID:	13484  

    Click image for larger version. 

Name:	Normal page copy.jpg 
Views:	90 
Size:	44.6 KB 
ID:	13485  

  4. #4

    Default Re: Minimum and Maximum stock count and displaying products in list based on criteria

    Additional photo showing the fields when we edit products which were used in above code. I rearranged the product fields to make easier to enter and put at top of page for easy access.
    Attached Images Attached Images  

 

 

Similar Threads

  1. v151 Send low stock email based on value in custom minimum field for individual products
    By jpietrowiak in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 17 Aug 2015, 07:12 AM
  2. Changing minimum / maximum quantity based off of attributes
    By emeryc in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 9 Jun 2013, 09:09 AM
  3. Hide stock count and not check for out of stock
    By microbe in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 12 Feb 2008, 12:08 AM
  4. displaying categories and products in left and rightside
    By thread_PHP in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 2 Oct 2007, 03:30 PM
  5. Replies: 3
    Last Post: 16 Jan 2007, 06:58 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR