Results 1 to 2 of 2

Sub-category pics

This is a discussion on Sub-category pics within the osCommerce 2.2 Modification Help forums, part of the osCommerce 2.2 Forums category; My shopping cart has several categories and Subcategories ( as most of the carts do!). When I click on a ...

      
  1. #1
    Member
    Join Date
    Dec 2002
    Posts
    87
    Rep Power
    0


    Default Sub-category pics

    My shopping cart has several categories and Subcategories ( as most of the carts do!). When I click on a particular category in the left column,it reads "Displaying 0 to 0 (of 0 products) ". is it supposed to do that. I would like to have subcategory pics on the page when someone clicks on a particular category link.

    appreciate your help.

  2. #2
    Member
    Join Date
    Nov 2002
    Location
    Pennsylvania
    Posts
    93
    Rep Power
    0


    Default

    I think if I understand your question, you want to display items, and then the items sub-categories.

    You will need to edit the following:

    locate the following in index.php (MS2) or default.php (MS1)
    <tr>
    <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
    </tr>
    <tr>
    <td><?php include(DIR_WS_MODULES . FILENAME_PRODUCT_LISTING); ?></td>
    </tr>
    Then just above this you will paste the following:
    <tr>
    <td>

    <table border="0" width="100%" cellspacing="0" cellpadding="2"><tr>
    <?php
    if(isset($cPath)){
    if(ereg('_',$cPath)){
    $category_links=array_reverse($cPath_array);
    $cat_to_search=$category_links[0];
    } else{
    $cat_to_search=$cPath;
    }

    //check to see if there are deeper sub categories within the current category
    $categories_query = tep_db_query("select c.categories_id,cd.categories_name,c.categories_im age,c.parent_id from ".TABLE_CATEGORIES." c, ".TABLE_CATEGORIES_DESCRIPTION." cd where c.parent_id = '".$cat_to_search."' and c.categories_id=cd.categories_id and cd.language_id='".$languages_id."'order by sort_order ,cd.categories_name");

    if(tep_db_num_rows($categories_query)>0){
    $rows=0;
    while($categories=tep_db_fetch_array($categories_q uery)){
    $rows++;
    $cPath_new=tep_get_path($categories['categories_id']);
    $width=(int)(100/MAX_DISPLAY_CATEGORIES_PER_ROW).'%';
    echo '<td align="center" class="smallText" style="width: ' . $width . '" valign="top"><a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">' . tep_image(DIR_WS_IMAGES . $categories['categories_image'], $categories['categories_name']) . '</a><br><a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">' . $categories['categories_name'] . '</a> </td>' . "\n";
    if((($rows/MAX_DISPLAY_CATEGORIES_PER_ROW)==floor($rows/MAX_DISPLAY_CATEGORIES_PER_ROW))&&($rows!= tep_db_num_rows($categories_query))){
    echo'</tr>'."\n";
    echo'<tr>'."\n";
    }
    }
    }
    }
    ?>
    </tr>
    </table>

    </td>
    </tr>
    Hope this is what you were looking for.

    |3ackdraft
    There\'s something about fireman, day and night they are always fireman!

Similar Threads

  1. Adding Category Descriptions in Category List for each Cat.
    By el1jones in forum osCmax v2 Customization/Mods
    Replies: 1
    Last Post: 03-15-2006, 01:37 AM
  2. mo pics
    By winkscustoms in forum osCmax v1.7 Discussion
    Replies: 0
    Last Post: 03-20-2005, 07:08 PM
  3. Showing pics above the description on category page
    By Christy in forum osCmax v1.7 Discussion
    Replies: 0
    Last Post: 08-03-2004, 08:27 PM
  4. Align pics in category headers?
    By fridgemags in forum osCmax v1.7 Discussion
    Replies: 0
    Last Post: 06-08-2004, 11:29 AM
  5. "edit category" pics gone
    By bushman in forum osCmax v1.7 Discussion
    Replies: 0
    Last Post: 08-29-2003, 09:06 AM

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
  •