Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

SCH_001

Adding QTY label to Categories / Products view

Recommended Posts

Posted (edited)

Hi everyone, in osCommerce Online Merchant v2.3.4.1 CE how do I add a QTY column after the Status option
So move the Status option to the left and add a column showing me the QTY of each item, see image.
I know I need to edit categories.php in admin, but I can not work out what and where to add

 

Capture.thumb.JPG.84ebbea7bb447a79f6a8fc317436d20e.JPG

 

Edited by SCH_001

Share this post


Link to post
Share on other sites
vor 1 Stunde schrieb SCH_001:

Hi everyone, in osCommerce Online Merchant v2.3.4.1 CE how do I add a QTY column after the Status option
So move the Status option to the left and add a column showing me the QTY of each item, see image.
I know I need to edit categories.php in admin, but I can not work out what and where to add

 

Capture.thumb.JPG.84ebbea7bb447a79f6a8fc317436d20e.JPG

 

find:

                <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_STATUS; ?></td>

change to:

                <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_STATUS; ?></td>
                <td class="dataTableHeadingContent" align="center"><?php echo 'count'; ?></td>

find:

                <td class="dataTableContent"><?php echo '<a href="' . tep_href_link(FILENAME_CATEGORIES, tep_get_path($categories['categories_id'])) . '">' . tep_image(DIR_WS_ICONS . 'folder.gif', ICON_FOLDER) . '</a>&nbsp;<strong>' . $categories['categories_name'] . '</strong>'; ?></td>
                <td class="dataTableContent" align="center">&nbsp;</td>

change to:

                <td class="dataTableContent"><?php echo '<a href="' . tep_href_link(FILENAME_CATEGORIES, tep_get_path($categories['categories_id'])) . '">' . tep_image(DIR_WS_ICONS . 'folder.gif', ICON_FOLDER) . '</a>&nbsp;<strong>' . $categories['categories_name'] . '</strong>'; ?></td>
                <td class="dataTableContent" align="center">&nbsp;</td>
                <td class="dataTableContent" align="center"><?php echo tep_products_in_category_count($categories['categories_id']);?></td>

 

Share this post


Link to post
Share on other sites
Posted (edited)

for all products with deactivated category to

find:

        $cInfo = new objectInfo($cInfo_array);

change to:

        $cInfo = new objectInfo($cInfo_array);

      $products_count_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = p2c.products_id and p2c.categories_id = '" . (int)$categories['categories_id'] . "'");
      $products_count = tep_db_fetch_array($products_count_query);
      $p_count = $products_count['total'];

find:

                <td class="dataTableContent"><?php echo '<a href="' . tep_href_link(FILENAME_CATEGORIES, tep_get_path($categories['categories_id'])) . '">' . tep_image(DIR_WS_ICONS . 'folder.gif', ICON_FOLDER) . '</a>&nbsp;<strong>' . $categories['categories_name'] . '</strong>'; ?></td>

change to:

                <td class="dataTableContent"><?php echo '<a href="' . tep_href_link(FILENAME_CATEGORIES, tep_get_path($categories['categories_id'])) . '">' . tep_image(DIR_WS_ICONS . 'folder.gif', ICON_FOLDER) . '</a> <strong>' . $categories['categories_name'] . ' / ' . $p_count . '</strong>'; ?></td>

 

Edited by YePix

Share this post


Link to post
Share on other sites

@YePix Thank you for assisting me.
This is now quite what I was after, this seems to give me a quantity of products in a category. I am seeking Products Quantity:

So I now have the heading - thank you just need the product QTY

Capture1 (Medium).jpeg

Share this post


Link to post
Share on other sites
vor 28 Minuten schrieb SCH_001:

@YePix Thank you for assisting me.
This is now quite what I was after, this seems to give me a quantity of products in a category. I am seeking Products Quantity:

So I now have the heading - thank you just need the product QTY

Capture1 (Medium).jpeg

find:

                <td class="dataTableContent" align="right"><?php if (isset($pInfo) && is_object($pInfo) && ($products['products_id'] == $pInfo->products_id)) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;</td>
              </tr>
<?php
    }

change to:

                <td class="dataTableContent" align="right"></td>
                <td class="dataTableContent" align="right"><?php if (isset($pInfo) && is_object($pInfo) && ($products['products_id'] == $pInfo->products_id)) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;</td>
              </tr>
<?php
    }

 

Share this post


Link to post
Share on other sites

find:

<td class="dataTableHeadingContent" align="center"><?php echo 'count'; ?></td>

change to:

<td class="dataTableHeadingContent" align="center"><?php if (!$_GET['cPath']){ echo 'count';} ?></td>

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×