Nevermind I've managed to figure this out for my self. In case anyone has a similar need here is how I managed to do this.
Copy includes/templates/template_default/templates/tpl_index_categories.php to includes/templates/YOUR_TEMPLATE/templates and edit line 52 as follows:
Change this
Code:
<div id="categoryImgListing" class="categoryImg"><?php echo zen_image(DIR_WS_IMAGES . $categories_image, '', SUBCATEGORY_IMAGE_TOP_WIDTH, SUBCATEGORY_IMAGE_TOP_HEIGHT); ?></div>
To this
Code:
<div id="categoryImgListing" class="categoryImg"><?php echo zen_image(DIR_WS_IMAGES . $categories_image, '', SUBCATEGORY_IMAGE_TOP_WIDTH, SUBCATEGORY_IMAGE_TOP_HEIGHT, 'name="imgSwap"'); ?></div>
Notice the name tag at the end - name="imgSwap", this is the only change. The name can be anything you want but remember it because you will use it again in a minute.
Now copy include/modules/product_listing.php to include/modules/YOUR_TEMPLATE and edit lines 166 and 168 (for some reason these lines are identical).
Change from this
Code:
$lc_text = '<a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ? zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $listing->fields['products_image'], $listing->fields['products_name'], IMAGE_PRODUCT_LISTING_WIDTH, IMAGE_PRODUCT_LISTING_HEIGHT, 'class="listingProductImage"') . '</a>';
To this
Code:
$lc_text = '<a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ? zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $listing->fields['products_image'], $listing->fields['products_name'], IMAGE_PRODUCT_LISTING_WIDTH, IMAGE_PRODUCT_LISTING_HEIGHT, 'class="listingProductImage" onMouseOver=document.imgSwap.src="' . DIR_WS_IMAGES . $listing->fields['products_image'] . '"; width="' . SUBCATEGORY_IMAGE_TOP_WIDTH . '" height="' . SUBCATEGORY_IMAGE_TOP_HEIGHT . '"') . '</a>';
Basically you are adding the following right afer the class tag:
Code:
onMouseOver=document.imgSwap.src="' . DIR_WS_IMAGES . $listing->fields['products_image'] . '"; width="' . SUBCATEGORY_IMAGE_TOP_WIDTH . '" height="' . SUBCATEGORY_IMAGE_TOP_HEIGHT . '"'
Be very careful with the quotes, if you don't get them right it won't work. You can just copy/paste this code.
Note the document.imgSwap.src, you will need to use whatever name you used in the other file in this tag, so it would be document.NAME.src.
That's it. Hope it works for you, enjoy.
Allen
Bookmarks