var zoomy = "\n\

Stashing inventory

\n\
\n\ \n\

\n\ This mod will let you 'save' 3 (or whatever #) pieces of inventory of each item. So if the true inventory is 50 pieces, the store will act like there is only 47. This will let you keep a stash around in case you need extras to replace customer's damaged or lost packages, or if your inventory is off by a few pieces.\n\

\n\ \n\

\n\ For example, we have 83 Mintyboosts in stock:\n\

\n\ \n\

\n\ \"\" \n\

\n\ \n\

\n\ But the cart displays only 80:\n\

\n\ \n\

\n\ \"\" \n\

\n\ \n\
\n\ \n\

New Files

\n\
\n\ \n\

\n\ We'll be using the same file as the "Show IN STOCK over 100 quantity" mod above\n\

\n\ \n\
\n\ \n\

Change Settings

\n\
\n\ \n\

\n\ Change the same settings as the "Show IN STOCK over 100 quantity" mod above\n\

\n\ \n\
\n\ \n\

Code changes

\n\
\n\ \n\

\n\ Files changed: /includes/functions/functions_lookups.php
\n\ \n\ /includes/functions/functions_general.php
\n\ \n\ /includes/modules/product_listing.php
\n\ \n\ /includes/modules/pages/product_info/main_template_vars.php
\n\

\n\ \n\

\n\ in /includes/functions/functions_lookups.php\n\

\n\ \n\

\n\ find (line 172)\n\

\n\
    return $stock_values->fields['products_quantity'];
\n\ \n\

\n\ and replace it with\n\

\n\
    return $stock_values->fields[\'products_quantity\'] - STOCK_OFFSET;
\n\ \n\

\n\ in /includes/functions/functions_general.php\n\

\n\ \n\

\n\ find (line 130)\n\

\n\
$button_check = $db->Execute("select product_is_call, products_quantity from " . TABLE_PRODUCTS . " where products_id = \'" . (int)$product_id . "\'");
\n\ \n\

\n\ and add a line below it so that it is looks like:\n\

\n\
$button_check = $db->Execute("select product_is_call, products_quantity from " . TABLE_PRODUCTS . " where products_id = \'" . (int)$product_id . "\'");\n\
$button_check->fields[\'products_quantity\'] = zen_get_products_stock($product_id);
\n\ \n\

\n\ in /includes/modules/product_info.php\n\

\n\ \n\

\n\ find (line 77)\n\

\n\
  while (!$listing->EOF) {\n\
    $rows++;
\n\ \n\

\n\ and replace with\n\

\n\
  while (!$listing->EOF) {\n\
    $rows++;\n\
    $listing->fields[\'products_quantity\'] = zen_get_products_stock($listing->fields[\'products_id\']);
\n\ \n\

\n\ in /includes/modules/pages/product_info/main_template_vars.php\n\

\n\ \n\

\n\ find (line 115)\n\

\n\
$products_quantity = $product_info->fields[\'products_quantity\'];
\n\ \n\

\n\ and replace it with \n\

\n\
  // Stock Offset Mod\n\
  $products_quantity = zen_get_products_stock($product_id);
\n\ \n\
\n\ ";document.write(zoomy);document.write("

This page was autogenerated from http://www.ladyada.net/wiki/tutorials/zencartmods/stashqty.html
Please edit the wiki to contribute any updates or corrections.
")