Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Add Catergory Images to Product Pages


datoupee

Recommended Posts

Posted

How do you add category images to product pages? These category images are found at the top right of the category pages which list items. I would like to have them remain on the top of the product page when users view each product.

 

This is my second OS store and still can't find out what code to add to "product_info.php". I've seen this done on some other OS stores.

Posted

I just tried adding the following code to the product_info.php page but the image dipsplays incorrectly ? :(

 

<td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . $category['categories_image'], $category['categories_name'], HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>

 

Any help would be great.

Posted

I think I figured it out... I was missing the entire code.

 

<?php

 

// Get the right image for the top-right

    $image = DIR_WS_IMAGES . 'table_background_list.gif';

    if (isset($HTTP_GET_VARS['manufacturers_id'])) {

      $image = tep_db_query("select manufacturers_image from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'");

      $image = tep_db_fetch_array($image);

      $image = $image['manufacturers_image'];

    } elseif ($current_category_id) {

      $image = tep_db_query("select categories_image from " . TABLE_CATEGORIES . " where categories_id = '" . (int)$current_category_id . "'");

      $image = tep_db_fetch_array($image);

      $image = $image['categories_image'];

    }

?>

            <td align="right"><?php echo tep_image(DIR_WS_IMAGES . $image, HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>

Archived

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

×
×
  • Create New...