Add Rotating Banner to Featured Products in Center Column in Zen Cart.

Edit …/includes/templates/template_default/templates/tpl_modules_featured_products.php

Add this script near bottom of page

<!-- bof: banner set -->
<div align="center">
<script  type="text/javascript">
<!--
/*
Script by FPMC at http://jsarchive.8m.com
Submitted to JavaScript Kit (http://javascriptkit.com)
For this and 400+ free scripts, visit http://javascriptkit.com
*/
//set image paths
src = ["images/stcls_banner.png",
"images/tkr_banner.png",
"images/fcp_banner.png",
"images/uelsa_banner.png",
"images/splh_banner.png"]
//set corresponding urls
url = ["index.php?main_page=index&cPath=1",
"index.php?main_page=index&cPath=1",
"index.php?main_page=index&cPath=1",
"index.php?main_page=index&cPath=1",
"index.php?main_page=index&cPath=1"]
//set duration for each image
duration = 5;
//Please do not edit below
ads=[]; ct=0;
function switchAd() {
var n=(ct+1)%src.length;
if (ads[n] && (ads[n].complete || ads[n].complete==null)) {
document["Ad_Image"].src = ads[ct=n].src;
}
ads[n=(ct+1)%src.length] = new Image;
ads[n].src = src[n];
setTimeout("switchAd()",duration*1000);
}
function doLink(){
location.href = url[ct];
} onload = function(){
if (document.images)
switchAd();
}
//-->
</script>
<a href="javascript:doLink();" onmouseover="status=url[ct];return true;"
onmouseout="status=''">
<img name="Ad_Image" src="images/uelsa_banner.png" border="0" alt=""/>
</a>
<!--<p align="center"><font face="arial" size="-2">This free script provided by <a href="http://javascriptkit.com">JavaScript Kit</a></font></p>-->
<br />
</div>
<!-- eof: banner set -->

Save to …/includes/templates/YOUR_TEMPLATE/templates/tpl_modules_featured_products.php

This script has been updated to meet XHTML 1.0 Transitional validation

Leave a Reply

Your email address will not be published. Required fields are marked *

Design by FtroopDad Theme by itx