Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Display Sub-Category Image


d4funky1

Recommended Posts

Hi,

 

please take a look at the following url:

 

Here

 

As you can see all sub-category names are listed but i wonder how you can attach an image to also show above the name?

 

I have tried adding an image in the admin panel but this seems to do nothing.

 

Many Thanks

D4

Link to comment
Share on other sites

Open up index.php in a text editor and look for the following line:

 

while ($categories = tep_db_fetch_array($categories_query)) {

 

 

The standard code just below it is:

 

	  $rows++;
  $cPath_new = tep_get_path($categories['categories_id']);
  $width = (int)(100 / MAX_DISPLAY_CATEGORIES_PER_ROW) . '%';
  echo '				<td align="center" class="smallText" width="' . $width . '" valign="top"><a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">' . tep_image(DIR_WS_IMAGES . $categories['categories_image'], $categories['categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '<br>' . $categories['categories_name'] . '</a></td>' . "\n";
  if ((($rows / MAX_DISPLAY_CATEGORIES_PER_ROW) == floor($rows / MAX_DISPLAY_CATEGORIES_PER_ROW)) && ($rows != $number_of_categories)) {
	echo '			  </tr>' . "\n";
	echo '			  <tr>' . "\n";
  }
}

 

Try replacing what you have there with the above :)

 

Sonia

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...