This will use images named for each category just by uploading them; no individual admin work needed.
Edit /includes/modules/your_template/category_row.php.
Find
PHP Code:
while (!$categories->EOF) {
if (!$categories->fields['categories_image']) !$categories->fields['categories_image'] = 'pixel_trans.gif';
and replace with
PHP Code:
while (!$categories->EOF) {
$cat_image = file_exists(DIR_WS_IMAGES . 'categoryimg' . $categories->fields['categories_id'] . '.jpg')? 'categoryimg' . $categories->fields['categories_id'] . '.jpg': 'pixel_trans.gif';
if (!$categories->fields['categories_image']) !$categories->fields['categories_image'] = $cat_image;
Name the images like categoryimg23.jpg (replacing 23 with the category's id) and save in /images/.
Using the first product's image is more complicated unless it can be guaranteed that they will all be .jpg (or another fixed type).
Bookmarks