PDA

View Full Version : [BugFix] v1.5 Category Descriptions Bug



michael_s
09-25-2003, 10:50 PM
Hi all,

This bugfix corrects a problem with the Category Descriptions mod in MS2-MAX v1.5.1 and earlier.

Bug Description
This bug causes category descriptions in Sub Categories not to display, as well as any new Main category descriptions that you may add.

Bug Fix
If you have not made any changes to the index_products.tpl.php file, just unzip the attached archive and upload the file to your /catalog/templates/content directory, overwriting the existing file.

If you have made changes to the file, find this code:


// 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>
</tr>

And, immediately after the </tr> tag, add the following code:

<?php if ( (ALLOW_CATEGORY_DESCRIPTIONS == 'true') && (tep_not_null($category['categories_description']) ) ) { ?>
<tr>
<td align="left" colspan="2" class="category_desc"><?php echo $category['categories_description']; ?></td>
</tr>
<?php } ?>

Thats it. Bug Fixed. This updates the current full version to v1.5.2.