Community Add-Ons
Default image in products and categories 1.0
for osCommerce Online Merchant v2.2
OSCommerce displays a "missing image" icon each time you don not insert a image for products or categories. You can switch the toggle "image required" how you like - outcome remains the same.
This little hack solves the problem as it uses a 'default.gif' for those two. You could also use a transparent gif if you do not want to display any picture for some of the categories.
Enjoy!
Thomas A. Reinert
Full Version
I addin for Categorie fix for 2.2
Für Kategorien (dieser Bereich ist neu)
Finde:
echo tep_image(DIR_WS_CATALOG_IMAGES . $categories_image_name, $pInfo->categories_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align="right" hspace="5" vspace="5"') . $pInfo->categories_description;
Ersetzen durch:
<?php
//BOF: Default-image hack
//REPLACE: echo tep_image(DIR_WS_CATALOG_IMAGES . $categories_image_name, $cInfo->categories_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align="right" hspace="5" vspace="5"') . $cInfo->categories_description; ?>
if ($categories_image_name) {
echo tep_image(DIR_WS_CATALOG_IMAGES . $categories_image_name, $pInfo->categories_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align="right" hspace="5" vspace="5"') . $pInfo->categories_description;
} else {
echo tep_image(DIR_WS_CATALOG_IMAGES . 'default.gif', $pInfo->categories_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align="right" hspace="5" vspace="5"') . $pInfo->categories_description;
}
//EOF: Default-image hack
?>
-------------------------------------------------
finde (dieser Bereich ist neu):
echo tep_draw_hidden_field('categories_image', stripslashes($categories_image_name));
Ersetzen durch:
//BOF: Default-image hack
// Replace: echo tep_draw_hidden_field('categories_image', stripslashes($categories_image_name));
if ($categories_image_name) {
echo tep_draw_hidden_field('categories_image', stripslashes($categories_image_name));
} else {
echo tep_draw_hidden_field('categories_image', 'default.gif');
}
//EOF: Default-image hack
