Results 1 to 3 of 3

Hybrid View

  1. #1
    Join Date
    Jul 2007
    Location
    Exeter, New Hampshire, USA
    Posts
    15
    Plugin Contributions
    0

    Default Product Stock Report stock number not id

    I am setting up a store for vintage Rolls Royce tools. My customer has asked if, when he looks at the "Product Stock Report" he can see the product stock number as well as or in place of the product ID number assigned by ZenCart?
    Is there a way to do this? I am currenty usiing a fresh install of v1.3.9h and can't seem to find a way to do this.
    Thanks

  2. #2
    Join Date
    Jan 2010
    Location
    Australia
    Posts
    244
    Plugin Contributions
    1

    Default Re: Product Stock Report stock number not id

    I am confused wat product stock number u are talking but file is admin>>stats_products_lowstock.php

    and modify accordingly

  3. #3
    Join Date
    Jul 2007
    Location
    Exeter, New Hampshire, USA
    Posts
    15
    Plugin Contributions
    0

    Default Re: Product Stock Report stock number not id

    Ok. I've struggled with this a couple of times. I'm not good with PHP so please bear with me. Rather than use the id number that Zen assigns each product automatically I want to use the Product model number you can assign to each product.
    I have tried modifying admin/stats_products_lowstock.php by changing every instance of product_id in the code to product_model with no luck. I have cleared the browser history etc to be sure I'm not seeing an old version of the page. Below is the code from lowstock.php. What am I missing?

    <?php
    //
    // +----------------------------------------------------------------------+
    // |zen-cart Open Source E-commerce |
    // +----------------------------------------------------------------------+
    // | Copyright (c) 2003 The zen-cart developers |
    // | |
    // | http://www.zen-cart.com/index.php |
    // | |
    // | Portions Copyright (c) 2003 osCommerce |
    // +----------------------------------------------------------------------+
    // | This source file is subject to version 2.0 of the GPL license, |
    // | that is bundled with this package in the file LICENSE, and is |
    // | available through the world-wide-web at the following url: |
    // | http://www.zen-cart.com/license/2_0.txt. |
    // | If you did not receive a copy of the zen-cart license and are unable |
    // | to obtain it through the world-wide-web, please send a note to |
    // | license AT zen-cart DOT com so we can mail you a copy immediately. |
    // +----------------------------------------------------------------------+
    // $Id: stats_products_lowstock.php 17534 2010-09-08 19:50:34Z wilt $
    //
    require('includes/application_top.php');
    ?>
    <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html <?php echo HTML_PARAMS; ?>>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
    <title><?php echo TITLE; ?></title>
    <link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
    <link rel="stylesheet" type="text/css" href="includes/cssjsmenuhover.css" media="all" id="hoverJS">
    <script language="javascript" src="includes/menu.js"></script>
    <script language="javascript" src="includes/general.js"></script>
    <script type="text/javascript">
    <!--
    function init()
    {
    cssjsmenu('navbar');
    if (document.getElementById)
    {
    var kill = document.getElementById('hoverJS');
    kill.disabled = true;
    }
    }
    // -->
    </script>
    </head>
    <body onLoad="init()">
    <!-- header //-->
    <?php require(DIR_WS_INCLUDES . 'header.php'); ?>
    <!-- header_eof //-->
    <!-- body //-->
    <table border="0" width="100%" cellspacing="2" cellpadding="2">
    <tr>
    <!-- body_text //-->
    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
    <tr>
    <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
    <tr>
    <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
    <td class="pageHeading" align="right"><?php echo zen_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
    </tr>
    </table></td>
    </tr>
    <tr>
    <td><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"><?php echo TABLE_HEADING_NUMBER; ?></td>
    <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_PRODUCTS; ?></td>
    <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_VIEWED; ?>&nbsp;</td>
    </tr>
    <?php
    if (isset($_GET['page']) && ($_GET['page'] > 1)) $rows = $_GET['page'] * MAX_DISPLAY_SEARCH_RESULTS_REPORTS - MAX_DISPLAY_SEARCH_RESULTS_REPORTS;
    $rows = 0;
    $products_query_raw = "select p.products_id, pd.products_name, p.products_quantity, p.products_type from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_model = pd.products_model and pd.language_id='" . $_SESSION['languages_id'] . "' order by p.products_quantity, pd.products_name";
    $products_split = new splitPageResults($_GET['page'], MAX_DISPLAY_SEARCH_RESULTS_REPORTS, $products_query_raw, $products_query_numrows);
    $products = $db->Execute($products_query_raw);
    while (!$products->EOF) {
    // only show low stock on products that can be added to the cart
    if ($zc_products->get_allow_add_to_cart($products->fields['products_model']) == 'Y') {
    $rows++;
    if (strlen($rows) < 2) {
    $rows = '0' . $rows;
    }
    $type_handler = $zc_products->get_admin_handler($products->fields['products_type']);
    $cPath = zen_get_product_path($products->fields['products_model']);
    ?>
    <tr class="dataTableRow" onMouseOver="rowOverEffect(this)" onMouseOut="rowOutEffect(this)" onClick="document.location.href='<?php echo zen_href_link($type_handler, '&product_type=' . $products->fields['products_type'] . '&cPath=' . $cPath . '&pID=' . $products->fields['products_model'] . '&action=new_product'); ?>'">
    <td class="dataTableContent" align="right"><?php echo $products->fields['products_model']; ?>&nbsp;&nbsp;</td>
    <td class="dataTableContent"><?php echo '<a href="' . zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $products->fields['products_model']) . '">' . $products->fields['products_name'] . '</a>'; ?></td>
    <td class="dataTableContent" align="center"><?php echo $products->fields['products_quantity']; ?>&nbsp;</td>
    </tr>
    <?php
    }
    $products->MoveNext();
    }
    ?>
    </table></td>
    </tr>
    <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']); ?></td>
    </tr>
    </table></td>
    </tr>
    </table></td>
    </tr>
    </table></td>
    <!-- body_text_eof //-->
    </tr>
    </table>
    <!-- body_eof //-->
    <!-- footer //-->
    <?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
    <!-- footer_eof //-->
    </body>
    </html>
    <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

 

 

Similar Threads

  1. Stock by Attribute setup and product has stock when added to card says out of stock
    By kwrosenzweig in forum All Other Contributions/Addons
    Replies: 3
    Last Post: 9 Jun 2011, 06:18 PM
  2. How to remover number in stock form 1 product?
    By Donanater in forum Customization from the Admin
    Replies: 0
    Last Post: 22 Mar 2011, 11:08 PM
  3. Replies: 2
    Last Post: 8 Jun 2008, 07:06 PM
  4. Omit the stock number on product pages
    By nomadrw in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 30 Oct 2007, 07:45 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
  •