Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Changing Catagory Title To The Actual Title I'm Selling


mjsmikey

Recommended Posts

I would like to Change the word Catagories, at the top of any Pre Catagory Page to the Title of the Catagories I just Clicked on. Example ... If I clicked on Basketball (311) then I want the Page Title to Change to Basketball and the word Catagories to Change to Basketball.

 

I would like the same thing to happen when I click the Catagory... It used to Say "Lets See what we have here" but i changed it to "Products",

 

I already got my Meta Title to Do this with the Meta Tag Contribution.

Link to comment
Share on other sites

I would like to Change the word Catagories, at the top of any Pre Catagory Page to the Title of the Catagories I just Clicked on. Example ... If I clicked on Basketball (311) then I want the Page Title to Change to Basketball and the word Catagories to Change to Basketball.

 

I would like the same thing to happen when I click the Catagory... It used to Say "Lets See what we have here" but i changed it to "Products",

 

I already got my Meta Title to Do this with the Meta Tag Contribution.

 

I think this is listed in the knowledge base as well but I have it in my personal notes so here ya go:

 

Replace Page Heading Title with the name of Categories or Subcategories:

 

Get rid of "Let's See What We Have Here" for Subcategories and "Categories" for top-categories. You can dynamically replace them with the name of the categories or subcategories name. This is a very cool hack.

 

In the “/catalog/index.php” file, there are three lines of code such as:

<?php echo HEADING_TITLE; ?>

 

FOR CATEGORIES, find the first one:

 

<?php echo HEADING_TITLE; ?>

 

Replace with:

 

<?php echo $category['categories_name'] ?>

 

 

FOR SUBCATEGORIES, find the second one:

 

<?php echo HEADING_TITLE; ?>

 

 

Replace with:

 

 

<?php if (isset($HTTP_GET_VARS['manufacturers_id'])) {  
	$category_query = tep_db_query("select manufacturers_name from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'");
	$category = tep_db_fetch_array($category_query);
	if ($category['manufacturers_name'] != "") {echo $category['manufacturers_name'];} else { echo HEADING_TITLE;}
  } else { 
	$category_query = tep_db_query("select cd.categories_name from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . (int)$current_category_id . "' and cd.categories_id = '" . (int)$current_category_id . "' and cd.language_id = '" . (int)$languages_id . "'");
	$category = tep_db_fetch_array($category_query);
	if ($category['categories_name'] != "") {echo $category['categories_name'];} else { echo HEADING_TITLE;}
  }
?>

There is nothing to modify with the third line of code <?php echo HEADING_TITLE; ?> so just leave it be.

Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

Link to comment
Share on other sites

  • 10 months later...

In a site that is unfortunately down I found not only how to change the word "categories" to the actual name of the category (say "printers") but ALSO how to display the name of the category on the title bar (since I am not sure if the term is corect i mean the blue bar at the top of the page that now says

 

"Changing Catagory Title To The Actual Title I'm Selling - osCommerce Community Support Forums"

 

 

So it now says "Printers-Myshop.gr" instead of jyust "Myshop.gr"!!! The problem is that since the site I found this is down i dont REMEMBER how I did it!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

 

Does anybody know how this is done or at least the file I have to change!!!!!

 

regards

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...