ozstar Posted November 30, 2005 Share Posted November 30, 2005 HI, This seems to be just what I need however I can't get it to work even with the update changes. Display Category Name In Main Content by Nik Le Page Two files to change.. 1. catalog/inc/lang/eng/index.php - works (it just changes the title "Look what we see' 2. catalog/index.php - doesn't seem to work - only puts a "/" where the actual Catalog name should be. This is the code In /catalog/index.php, find this code (line 232 in clean osCommerce v2.2 MS) - <td><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td class="pageHeading"><?php echo HEADING_TITLE; ?></td> <?php // optional Product List Filter to something like: <td><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td class="pageHeading"> <?php // hacked to display current category name in main content area! Nik echo HEADING_TITLE . '\'' . $tree[$current_category_id]['name'] . '\''; ?> </td> <?php // optional Product List Filter Quote Link to comment Share on other sites More sharing options...
Guest Posted December 11, 2005 Share Posted December 11, 2005 I have had this contrib installed for some time and noticed soon after installing that all I got most of the time was blank where the tree name was supposed to be. I'm just now revisiting it and am finding that it seems no one else has a solution either. If anyone has a solution it would be great to hear from you. I beleive it's just not the right call function, but not being a php'er only hacker at best I don't know what to do with it. HI, This seems to be just what I need however I can't get it to work even with the update changes. Display Category Name In Main Content by Nik Le Page Two files to change.. 1. catalog/inc/lang/eng/index.php - works (it just changes the title "Look what we see' 2. catalog/index.php - doesn't seem to work - only puts a "/" where the actual Catalog name should be. This is the code In /catalog/index.php, find this code (line 232 in clean osCommerce v2.2 MS) - <td><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td class="pageHeading"><?php echo HEADING_TITLE; ?></td> <?php // optional Product List Filter to something like: <td><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td class="pageHeading"> <?php // hacked to display current category name in main content area! Nik echo HEADING_TITLE . '\'' . $tree[$current_category_id]['name'] . '\''; ?> </td> <?php // optional Product List Filter Quote Link to comment Share on other sites More sharing options...
Guest Posted December 11, 2005 Share Posted December 11, 2005 I have had this contrib installed for some time and noticed soon after installing that all I got most of the time was blank where the tree name was supposed to be. I'm just now revisiting it and am finding that it seems no one else has a solution either. If anyone has a solution it would be great to hear from you. I beleive it's just not the right call function, but not being a php'er only hacker at best I don't know what to do with it. Just found the answer here: http://www.oscommerce.com/forums/index.php?showtopic=167121&hl= Replace this, as per this particular contribution. <?php echo HEADING_TITLE . '\'' . ($tree[$current_category_id]['name']) . '\''; ?> With this <?php echo HEADING_TITLE . '\'' . $category['categories_name'] . '\''; ?> And add this just above. (See more detail below) $category_query = tep_db_query("select categories_name from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . (int)$current_category_id . "' and language_id = '" . (int)$languages_id . "'"); $category = tep_db_fetch_array($category_query); What you need to end up with is this. } } $category_query = tep_db_query("select categories_name from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . (int)$current_category_id . "' and language_id = '" . (int)$languages_id . "'"); $category = tep_db_fetch_array($category_query); ?> <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 . '\'' . $category['categories_name'] . '\''; ?></td> I've actually tweeked mine a little further so the catagory name stands out better and it can be done to your desire but you should get the idea from the example below. <?php echo '<font size="2">' . HEADING_TITLE . '</font>\'' . $category['categories_name'] . '\''; ?> I had a hunch this sort of query would be required, I'm glad someone else was able to get a working function for this. Thanks very much go to the author this. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.