Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Modifying the Category list and Page Headings


Insiyah

Recommended Posts

Posted

1. I use this simple bit of CSS (below) to make a nice easy rollover for some quick navigation on a site I made. Is there anyway to make the category list in the template use something like this? If so anyone have any idea how to implement it?

 

2. I would like the category names to show up on the links at the top, I think it would be the Page Heading. I would think that it should change with every link but right now it has only 1 heading and I can't seem to figure out how that would be done.

 

3. How to I get rid of the count (5) or whatever next to each category?

 

Any and all help will be appreciated.

 

#menu {

float: right;

background: #fff url(images/barul.gif) no-repeat bottom right;

color: #808080;

padding: 18px 1px 11px 0;

margin: 0;

}

#menu li {

padding: 14px 18px 14px 18px;

color: #444;

background: #fff url(images/bar.gif) no-repeat bottom left;

display: inline;

}

#menu li.active {

background: #fff url(images/baractive.gif) no-repeat bottom left;

color: #8D9CAF;

font-weight: bold;

padding: 14px 18px 14px 18px;

margin: 0 1px 0 0;

}

#menu li a {

background: #f8f8f8;

color: #808080;

text-decoration: none;

}

#menu li a:hover {

color: #000;

background: #f8f8f8;

}

 

thanks,

Posted

Hi Insiyah

 

Of the 3 things you would like to change let's begin with the easiest. To remove the numbers appearing beside the categories. Go to includes>boxes>categories.php and find the following code:

 

	$categories_string .= '</a>';

if (SHOW_COUNTS == 'true') {
  $products_in_category = tep_count_products_in_category($counter);
  if ($products_in_category > 0) {
	$categories_string .= ' (' . $products_in_category . ')';
  }
}

 

Change the word true to false as seen below:

 

   if (SHOW_COUNTS == 'false') {

 

Next, to accomplish what I think you are describing for the categories to appear in the URL, you would need the Search Engine Friendly URLs contribution.

http://www.oscommerce.com/community/contributions,2823/

 

Finally, changing the appearance of the side columns to have mouseover effects is relatively easy

to do but does require some work. PM me, I have some modified files that may be useful.

Posted

Great, I will take care of the 1st, but I think I didn't describe the second item correctly. What I want is that the category link from the left side, let's say Product 1, when a user clicks Product 1 they go to a page of product 1, at the top of the content area there is a title or heading which I want to say Product 1, right now it is generic and says Product on all links. Wow, does that make any sense?

 

And I will definitely PM you on the other issue.

 

Thanks so much.

 

 

Hi Insiyah

 

Of the 3 things you would like to change let's begin with the easiest. To remove the numbers appearing beside the categories. Go to includes>boxes>categories.php and find the following code:

 

	$categories_string .= '</a>';

if (SHOW_COUNTS == 'true') {
  $products_in_category = tep_count_products_in_category($counter);
  if ($products_in_category > 0) {
	$categories_string .= ' (' . $products_in_category . ')';
  }
}

 

Change the word true to false as seen below:

 

   if (SHOW_COUNTS == 'false') {

 

Next, to accomplish what I think you are describing for the categories to appear in the URL, you would need the Search Engine Friendly URLs contribution.

http://www.oscommerce.com/community/contributions,2823/

 

Finally, changing the appearance of the side columns to have mouseover effects is relatively easy

to do but does require some work. PM me, I have some modified files that may be useful.

Posted
I am having the same problem with the category in header links. Anyone know how to do this.

 

I've been told there are many ways to do this some better than others but I found this on http://oscommercehowto.com. It worked like a charm. No problems, but backup just in case.

 

You’ll only need to modify index.php. First do a text search for HEADING_TITLE in this file. There should be five occurrences. We’ll change two of those occurrences that look like this:

 

<?php echo HEADING_TITLE; ?>

into this:

 

<?php echo $myCategory['categories_name']; ?>

Don’t touch the one around line 290 - this one prints out the one on the main index page.

 

The other two will look like this (between commas):

 

HEADING_TITLE

change those two:

 

$myCategory['categories_name']

And finally you’ll need to add these two lines to your code right after line 57:

 

<?php

if ($category_depth == 'nested') {

Now should look like this:

 

<?php

$myCategory_query = tep_db_query("select cd.categories_name, c.categories_image 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 . "'");

$myCategory = tep_db_fetch_array($myCategory_query);

if ($category_depth == 'nested') {

And now we can enjoy our category name when visiting categories like this:

Archived

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

×
×
  • Create New...