Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

How do I display the category name instead of "Categori


westkoast

Recommended Posts

When you click on a category in the left categories nav, the page title diaplays "Categories"

 

Does anyone know how I can change this to display the name of the category the user is in...ie. "Hardware" or what ever category they are in...

I need to read the rules more often...

Link to comment
Share on other sites

  • 1 month later...

this requires some editing of the default.php file.

 

Back up this file before proceeding!!!!

 

Find all occurences of;

 

<td class="pageHeading" align="right"><?php echo HEADING_TITLE; ?></td>

 

....and change with.....

 

<td class="pageHeading" align="right">

<?php 

  $cats_query = tep_db_query("select cd.categories_name from " . TABLE_CATEGORIES_DESCRIPTION . " cd where cd.categories_id = '" . $current_category_id . "' and cd.language_id = '" . $languages_id . "'");

     $cats = tep_db_fetch_array($cats_query);

  echo $cats['categories_name']; 

?>

</td>

 

This should show the category name in the listing rather than 'Categories'

 

Let me know how things go and please back up the default.php file before starting!!!!!!

Reddy to Rumble

 

Thank you osCommerce and all who Contribute to her!

Link to comment
Share on other sites

The change I made was slightly different and will save you the extral sql query when loading category listings. I am by no means a php expert, so I may have missed something. It works great on my site though.

 

In /catalog/includes/languages/[lang_here]/default.php:

 

Find the define for heading_title and change it to

 

  define('HEADING_TITLE', ucwords(strtolower($categories['categories_name'])));

[/b]

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...