SCH_001 Posted June 28, 2022 Share Posted June 28, 2022 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 Link to comment Share on other sites More sharing options...
YePix Posted June 28, 2022 Share Posted June 28, 2022 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 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> <strong>' . $categories['categories_name'] . '</strong>'; ?></td> <td class="dataTableContent" align="center"> </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'] . '</strong>'; ?></td> <td class="dataTableContent" align="center"> </td> <td class="dataTableContent" align="center"><?php echo tep_products_in_category_count($categories['categories_id']);?></td> Link to comment Share on other sites More sharing options...
YePix Posted June 28, 2022 Share Posted June 28, 2022 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> <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> Link to comment Share on other sites More sharing options...
SCH_001 Posted June 30, 2022 Author Share Posted June 30, 2022 @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 Link to comment Share on other sites More sharing options...
YePix Posted June 30, 2022 Share Posted June 30, 2022 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 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>'; } ?> </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>'; } ?> </td> </tr> <?php } Link to comment Share on other sites More sharing options...
YePix Posted June 30, 2022 Share Posted June 30, 2022 find: <td class="dataTableHeadingContent" align="center"><?php echo 'count'; ?></td> change to: <td class="dataTableHeadingContent" align="center"><?php if (!$_GET['cPath']){ echo 'count';} ?></td> Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.