X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   How do I add Javascript? (https://forum.x-cart.com/showthread.php?t=41047)

Group Imaging 07-11-2008 08:31 AM

How do I add Javascript?
 
I want to create a menu that corresponds to the rest of my site inside of x-cart on in the header. Where do I put the script code for it to affect the info in head.tpl?

balinor 07-11-2008 10:03 AM

Re: How do I add Javascript?
 
You'd need to put JS in the <head> tag which is in customer/home.tpl. You also need to surround most JS with {literal} tags to work:

{literal}
javascript here
{/literal}

Group Imaging 07-11-2008 01:01 PM

Re: How do I add Javascript?
 
Awesome, worked great. Thanks!

PengHead007 07-11-2008 03:55 PM

Re: How do I add Javascript?
 
Adding the script to customer/home.tpl works for all pages (including https) except the cart pages. I can't find where to add the script so my Comodo corner logo appears throughout the checkout process.

balinor 07-11-2008 04:14 PM

Re: How do I add Javascript?
 
If you are using Fast lane Checkout they have their own set of templates in the Modules/Fast Lane folder.

Group Imaging 07-14-2008 11:21 AM

Re: How do I add Javascript?
 
I thought I had this working and went to check it in IE and for some reason it doesn't work. Here is the link to my cart: http://remembermedisplay.com/order/home.php

I can't figure out why it would work fine in Firefox but not in IE. Any suggestions?

boomobile 07-31-2008 11:42 AM

Re: How do I add Javascript?
 
I need to add 2 javascript files, but not sure where to place them, where x-cart calls them, ect...
I'm using a dynamic drive scrolling marquee for the homepage only, so I'm placing the actual marquee code on that template, but what directory should I copy the two files?

Group Imaging 07-31-2008 12:02 PM

Re: How do I add Javascript?
 
It doesn't matter what directory you copy them to. You can create your own directory for them if you want to keep all your 3rd party scripts in a separate folder. You would just have to make sure that where it lists where your code is located, you set it to the directory that you have saved them in. It should look something like this:

Code:

<script language="javascript" src="<script type="text/javascript" src="highslide/highslide.js"></script>">

boomobile 07-31-2008 12:06 PM

Re: How do I add Javascript?
 
GI: I have other JS all in one file (it's big), so I'd like to keep this one separate. So where does the code to direct go? what file? and if I have several different JS file, will I need to adjust that, or just place them all in the same directory?

Group Imaging 07-31-2008 12:14 PM

Re: How do I add Javascript?
 
Think of it as similar to a CSS reference when you have an external style sheet. You put it in the <head> tags (usually I keep mine near the top to find it quickly). So if it's going into your cart you would be looking for the file skin1/customer/home.tpl. As far as I know there isn't a way to designate it only to the first page in x-cart so if you include it in there it will be loaded with every page of x-cart which shouldn't really matter because the function call is what actually references the file.

boomobile 07-31-2008 12:28 PM

Re: How do I add Javascript?
 
OK, so I tried to place it, but it breaks the code somewhere. I took out all extra spaces, and extra hard returns, but still won't display. It actually wipes out everything below that point. any suggestions?

boomobile 07-31-2008 12:36 PM

Re: How do I add Javascript?
 
Ok, so I placed the js file in my "scripts" folder with the other js. Copied page code directly from dynamic drive and placed it in the correct area that I want the marquee to display, but it breaks the code somewhere and everything after the code is blank.

Quote:

<div id="tempholder"></div>
<script language="JavaScript" src="../scripts/dhtmllib.js"></script>
<script language="JavaScript" src="../scripts/scroller.js"></script>
<script language="JavaScript">

/*
Mike's DHTML scroller (By Mike Hall)
Last updated July 21st, 02' by Dynamic Drive for NS6 functionality
For this and 100's more DHTML scripts, visit http://www.dynamicdrive.com
*/

//SET SCROLLER APPEARANCE AND MESSAGES
var myScroller1 = new Scroller(0, 0, 480, 32, 1, 5); //(xpos, ypos, width, height, border, padding)
myScroller1.setColors("#006600", "#ccffcc", "#009900"); //(fgcolor, bgcolor, bdcolor)
myScroller1.setFont("Verdana,Arial,Helvetica", 2);
myScroller1.addItem("<b>Click here for <a href='http://dynamicdrive.com'>Dynamic Drive</a>, the net\'s #1 DHTML site!</b>");
myScroller1.addItem("<b>Visit <a href='http://www.brainjar.com'>Brain Jar</a>, Mike\'s great coding site!</b>");
myScroller1.addItem("<b>Looking for free JavaScripts? Visit <a href='http://javascriptkit.com'>JavaScript Kit.</a>");
myScroller1.addItem("<b>Discuss and get help on web coding, at <a href='http://www.codingforums.com'>CodingForums.com</a></b>");

//SET SCROLLER PAUSE
myScroller1.setPause(2500); //set pause beteen msgs, in milliseconds

function runmikescroll() {

var layer;
var mikex, mikey;

// Locate placeholder layer so we can use it to position the scrollers.

layer = getLayer("placeholder");
mikex = getPageLeft(layer);
mikey = getPageTop(layer);

// Create the first scroller and position it.

myScroller1.create();
myScroller1.hide();
myScroller1.moveTo(mikex, mikey);
myScroller1.setzIndex(100);
myScroller1.show();
}

window.onload=runmikescroll
</script>
<div id="placeholder" style="position:relative; width:420px; height:32px;"> </div>
-----END SCROLLING MARQUEE---------------------------*}

Group Imaging 07-31-2008 12:40 PM

Re: How do I add Javascript?
 
Um, I think you may have this put in the wrong place? If that code is all within the <head> tags then you shouldn't have a <div> in there. If you have this in the <body> tags then you will need to move it before the </head> tag.

boomobile 07-31-2008 01:09 PM

Re: How do I add Javascript?
 
This is not in the head, this is the code for the actual marquee scroller. I can get it working just fine alone, but when I place it in the homepage.tpl it breaks the rest of the page.

Group Imaging 07-31-2008 01:15 PM

Re: How do I add Javascript?
 
Quote:

<script language="JavaScript" src="../scripts/dhtmllib.js"></script>
<script language="JavaScript" src="../scripts/scroller.js"></script>

Those need to be in the <head>

boomobile 07-31-2008 01:30 PM

Re: How do I add Javascript?
 
hmmm, I don't have any other refrences to java in my head.tpl , any other suggestions?
What about my common_js.tpl ? would I copy the js files I have into this? There's got to be a way to refrence it...

Group Imaging 07-31-2008 01:31 PM

Re: How do I add Javascript?
 
Sorry, it wouldn't be in head.tpl it would be in customer/home.tpl the head tags in there.

boomobile 07-31-2008 01:50 PM

Re: How do I add Javascript?
 
there aren't any head tags in any of my tpl files. I didn't create this shop, so I have no idea how things were modified. The person who did is of no help, he can't remember that far back... :(

Group Imaging 07-31-2008 01:55 PM

Re: How do I add Javascript?
 
Code from skin1_original/customer/home.tpl:

Quote:

{* $Id: home.tpl,v 1.88.2.10 2007/06/18 12:38:57 max Exp $ *}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
{if $printable ne ''}
{include file="customer/home_printable.tpl"}
{else}
{config_load file="$skin_config"}
<html>
<head>
<title>{strip}
{capture name=title}
{if $config.SEO.page_title_format eq "A"}
{section name=position loop=$location}
{if not %position.first%}&nbsp;::&nbsp;{/if}
{$location[position].0|strip_tags|escape}
{/section}
{else}
{section name=position loop=$location step=-1}
{if not %position.first%}&nbsp;::&nbsp;{/if}
{$location[position].0|strip_tags|escape}
{/section}
{/if}
{/capture}
{if $config.SEO.page_title_limit <= 0}
{$smarty.capture.title}
{else}
{$smarty.capture.title|replace:"&nbsp;":" "|truncate:$config.SEO.page_title_limit|replac e:" ":"&nbsp;"}
{/if}
{/strip}</title>
{include file="meta.tpl" }
<link rel="stylesheet" href="{$SkinDir}/{#CSSFile#}" />




</head>







<body{$reading_direction_tag}{if $body_onload ne ''} onload="javascript: {$body_onload}"{/if}>
{include file="rectangle_top.tpl" }
{include file="head.tpl" }
{if $active_modules.SnS_connector}
{include file="modules/SnS_connector/header.tpl"}
{/if}
<!-- main area -->
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td class="VertMenuLeftColumn">
{if $categories ne "" and ($active_modules.Fancy_Categories ne "" or $config.General.root_categories eq "Y" or $subcategories ne "")}
{include file="customer/categories.tpl" }
<br />
{/if}
{if $active_modules.Bestsellers ne "" and $config.Bestsellers.bestsellers_menu eq "Y"}
{include file="modules/Bestsellers/menu_bestsellers.tpl" }
{/if}
{if $active_modules.Manufacturers ne "" and $config.Manufacturers.manufacturers_menu eq "Y"}
{include file="modules/Manufacturers/menu_manufacturers.tpl" }
{/if}
{include file="customer/special.tpl"}
{if $active_modules.Survey && $menu_surveys}
{foreach from=$menu_surveys item=menu_survey}
{include file="modules/Survey/menu_survey.tpl"}
<br />
{/foreach}
{/if}
{include file="help.tpl" }
<img src="{$ImagesDir}/spacer.gif" width="150" height="1" alt="" />
</td>
<td valign="top" width="100%">
<!-- central space -->
{include file="location.tpl"}

{if $gcheckout_enabled and $main ne "cart" and $main ne "checkout" and $main ne "anonymous_checkout" and $main ne "order_message"}
<div align="right">{include file="modules/Google_Checkout/gcheckout_button.tpl"}</div>
{/if}

{include file="dialog_message.tpl"}

{if $active_modules.Special_Offers ne ""}
{include file="modules/Special_Offers/customer/new_offers_message.tpl"}
{/if}

{include file="customer/home_main.tpl"}
<!-- /central space -->
&nbsp;
</td>
<td class="VertMenuRightColumn">
{if $active_modules.SnS_connector && $config.SnS_connector.sns_display_button eq 'Y' && $sns_collector_path_url ne ''}
{include file="modules/SnS_connector/button.tpl"}
<br />
{/if}
{if $active_modules.Feature_Comparison ne "" && $comparison_products ne ''}
{include file="modules/Feature_Comparison/product_list.tpl" }
<br />
{/if}
{include file="customer/menu_cart.tpl" }
<br />
{if $login eq "" }
{include file="auth.tpl" }
{else}
{include file="authbox.tpl" }
{/if}
{include file="news.tpl" }
{if $active_modules.XAffiliate ne "" && $config.XAffiliate.partner_register eq 'Y'}
<br />
{include file="partner/menu_affiliate.tpl" }
{/if}
{if $active_modules.Interneka ne ""}
<br />
{include file="modules/Interneka/menu_interneka.tpl" }
{/if}
<br />
{include file="poweredby.tpl" }
<br />
<img src="{$ImagesDir}/spacer.gif" width="150" height="1" alt="" />
</td>
</tr>
</table>
{include file="rectangle_bottom.tpl" }
{if $active_modules.Google_Analytics ne "" && $config.Google_Analytics.ganalytics_code ne ""}
{include file="modules/Google_Analytics/ga_code.tpl"}
{/if}
</body>
</html>
{/if}


That's how the original is so you can try using that if there's not too much of a difference in what they have in there now. All you should really need is the top part that I separated out. I purposely included a bunch of extra line breaks in the code so you could where I'm talking about easily.

But all of that said, you should just be able to include those 2 lines of js reference right above the </head> tag even if you just created your own <head></head> tags. If you still aren't sure maybe you could post the code from customer/home.tpl

boomobile 07-31-2008 02:12 PM

Re: How do I add Javascript?
 
AHHH! home.tpl yes I see the head tags, will try it now...

boomobile 07-31-2008 02:16 PM

Re: How do I add Javascript?
 
ok, pasted:
<HEAD>
<script language="JavaScript" src="../scripts/dhtmllib.js"></script>
<script language="JavaScript" src="../scripts/scroller.js"></script>
</head>

Still can't get the marquee to show. There is something in the code breaking the page.

Group Imaging 07-31-2008 02:17 PM

Re: How do I add Javascript?
 
does it give any errors or is it a totally blank page?

boomobile 07-31-2008 02:28 PM

Re: How do I add Javascript?
 
everything coded after what I paste is gone. This includes the right side column.

Group Imaging 07-31-2008 02:42 PM

Re: How do I add Javascript?
 
Oh! Totally forgot..... try this:

{literal}
javascript here
{/literal}

You probably need to add those literal tags before and after your code.

boomobile 07-31-2008 03:20 PM

Re: How do I add Javascript?
 
Inserted the literal tag, still not working...I"m at a loss for what to do.

boomobile 08-06-2008 12:01 PM

Re: How do I add Javascript?
 
Quote:

Originally Posted by Group Imaging
If you still aren't sure maybe you could post the code from customer/home.tpl


Here is the homepage.tpl

{*-----BEGIN SCROLLING MARQUEE---------
<table width="100%"><tr>
<td align="center">
<div id="tempholder"></div>
<script language="JavaScript" src="dhtmllib.js"></script>
<script language="JavaScript" src="scroller.js"></script>
<script language="JavaScript">
/*
Mike's DHTML scroller (By Mike Hall)
Last updated July 21st, 02' by Dynamic Drive for NS6 functionality
For this and 100's more DHTML scripts, visit http://www.dynamicdrive.com
*/
//SET SCROLLER APPEARANCE AND MESSAGES
var myScroller1 = new Scroller(0, 0, 480, 100, 1, 5); //(xpos, ypos, width, height, border, padding)
myScroller1.setColors("#006699", "#FFFFFF", "#efefef"); //(fgcolor, bgcolor, bdcolor)
myScroller1.setFont("Verdana,Arial,Helvetica", 2);
myScroller1.addItem("<p align='center'><b>The all new Rip Curl E-Bombs are here!</b><br>E3: The third generation of Elastomax Superstretch Neoprene. Lighter, Warmer and More Flexible.</p>");
myScroller1.addItem("<p align='center'><b>Patagonia Wetsuits! Coming this fall!</b> <br>The arrival is quickly approaching┘ Cleanlinesurf is one of only 10 US authorized dealers. Check out the construction here.</p>");
myScroller1.addItem("<p align='center'><b>The all new F-Bombs are here!</b><br>Rip Curl F-Bomb Hooded Wetsuits with Fireskin lining! New and improved for Fall 08. Still the warmest available.</p>");
myScroller1.addItem("<p align='center'><b>On Sale Now:</b><br>&bull; O'neill Hammer 3/2 - $99.96<br>&bull; Billabong Foil GBS - $103.16<br>&bull; Billabong Foil FL - $77.56</p>");
//SET SCROLLER PAUSE
myScroller1.setPause(3000); //set pause beteen msgs, in milliseconds
function runmikescroll() {
var layer;
var mikex, mikey;
// Locate placeholder layer so we can use it to position the scrollers.
layer = getLayer("placeholder");
mikex = getPageLeft(layer);
mikey = getPageTop(layer);
// Create the first scroller and position it.
myScroller1.create();
myScroller1.hide();
myScroller1.moveTo(mikex, mikey);
myScroller1.setzIndex(100);
myScroller1.show();
}
window.onload=runmikescroll
</script>
<div id="placeholder" style="position:relative; width:480; height:100px;">
-----END SCROLLING MARQUEE---------------------------*}
<table width="100%" align="center">
<tr>
<td align="center"><table width="400" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><a href="home.php?cat=2091"><img src="images/manufacture_01-nixon.jpg" width="133" height="66" border="0" alt="Nixon Watches" /></a></td>
<td><a href="home.php?cat=614"><img src="images/manufacture_02-oneill.jpg" width="133" height="66" border="0" alt="Oneill Wetsuits" /></a></td>
<td><a href="home.php?cat=2019"><img src="images/manufacture_21-future.gif" width="133" height="66" border="0" alt="Future Fins, surfboard, fins" /></a></td>
</tr>
<tr>
<td>
<a href="javascript:openNewWindow('http://www.patagonia.com/usa/popup/media_gallery_photo.jsp?OPTION=SAR&assetid=18490', 'thewin','height=530,width=600, toolbar=no,scrollbars=yes')">
<img src="images/manufacture_00-patagonia.jpg" alt="Patagonia Coming Soon!" width="133" height="66" border="0" /></a></td>
<td><a href="home.php?cat=667"><img src="images/manufacture_05-ripcurl.jpg" width="133" height="66" border="0" alt="Rip Curl Wetsuits, Watches" /></a></td>
<td><a href="home.php?cat=904"><img src="images/manufacture_06-gsi.jpg" width="133" height="66" border="0" alt="GSI, Global Surf Industries" /></a></td>
</tr>
<tr>
<td><a href="home.php?cat=1864"><img src="images/manufacture_07-firewire.jpg" width="133" height="66" border="0" alt="Firewire Surfboards" /></a></td>
<td><a href="home.php?cat=662"><img src="images/manufacture_08-quiksilver.jpg" width="133" height="66" border="0" alt="Quiksilver Wetsuits" /></a></td>
<td><a href="home.php?cat=2020"><img src="images/manufacture_09-fcs.jpg" width="133" height="66" border="0" alt="FCS, Surfboard Fins" /></a></td>
</tr>
<tr>
<td><a href="home.php?cat=1311"><img src="images/manufacture_10-billabong.jpg" width="133" height="66" border="0" alt="Billabong Wetsuits" /></a></td>
<td><a href="home.php?cat=1029"><img src="images/manufacture_11-sector9.jpg" width="133" height="66" border="0" alt="Sector 9, Sector nine, skateboards, longboards" /></a></td>
<td><a href="home.php?cat=1517"><img src="images/manufacture_12-arnette.jpg" width="133" height="66" border="0" alt="Arnette Sunglasses" /></a></td>
</tr>
<tr>
<td><a href="home.php?cat=692"><img src="images/manufacture_13-roxy.jpg" width="133" height="66" border="0" alt="Roxy Women Wetsuits" /></a></td>
<td><a href="home.php?cat=456"><img src="images/manufacture_14-vestal.jpg" width="133" height="66" border="0" alt="Vestal Watches" /></a></td>
<td><a href="home.php?cat=1297"><img src="images/manufacture_15-dakine.jpg" width="133" height="66" border="0" alt="Dakine accessories" /></a></td>
</tr>
<tr>
<td><a href="home.php?cat=2"><img src="images/manufacture_16-oakley.jpg" width="133" height="66" border="0" alt="Oakley Sunglasses" /></a></td>
<td><a href="home.php?cat=1981"><img src="images/manufacture_17-arbor.jpg" width="133" height="66" border="0" alt="Arbor longboards, skateboards" /></a></td>
<td><a href="home.php?cat=1661"><img src="images/manufacture_18-vonzipper.jpg" width="133" height="66" border="0" alt="Von zipper sunglasses" /></a></td>
</tr>
<tr>
<td><a href="home.php?cat=1165"><img src="images/manufacture_04-spy.jpg" width="133" height="66" border="0" alt="Spy Sunglasses" /></a></td>
<td><a href="home.php?cat=1024"><img src="images/manufacture_03-ugg.jpg" width="133" height="66" border="0" alt="UGG boots" /></a></td>
<td><a href="home.php?cat=1980"><img src="images/manufacture_20-grain.gif" width="133" height="66" border="0" alt="Grain Surfboards" /></a></td>
</tr>
<tr>
<td><a href="http://www.cleanlinesurf.com/manufacturers.php?manufacturerid=40"><img src="images/manufacture_22-burton.jpg" alt="Burton" width="133" height="66" border="0" /></a></td>
<td><a href="https://www.cleanlinesurf.com/manufacturers.php?manufacturerid=46"><img src="images/manufacture_19-sitka.gif" width="133" height="66" border="0" alt="Sitka Clothing" /></a></td>
<td><a href="https://www.cleanlinesurf.com/manufacturers.php?manufacturerid=14"><img src="images/manufacture_23-hotline.gif" width="133" height="66" border="0" alt="hotline wetsuits"/></a></td>
</tr>
</table></td>
</tr>
</table>
<br />
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td background="{$ImagesDir}/newmenu_01.gif"><img src="images/space.gif" width="14" height="22" /></td>
<td background="{$ImagesDir}/newmenu_02.gif"><img src="images/space.gif" width="4" /><font color="#990000">Welcome to Cleanlinesurf.com!</font></td>
<td background="{$ImagesDir}/newmenu_03.gif"><img src="images/space.gif" width="14" height="22" /></td>
</tr>
<tr>
<td background="{$ImagesDir}/newmenu_04.gif"><img src="images/space.gif" width="14" height="100%" /></td>
<td>We are a full service surf shop located on the Northern Oregon Coast. Established in 1980 and locally owned and operated, Cleanline is The Northwest's &quot;Original&quot; Surf Shop. We carry the Northwest's largest selection of surfboards &amp; wetsuits, as well as a wide selection of quality, cutting edge gear to suit your lifestyle.
<p>Our goal is to provide you with the best shopping experience possible. Our friendly knowledgeable staff is here to serve you. If you are looking for something special that you don't see on our site, please give us a call: Toll Free at (888) 546-6176 or International at (503) 738-2061. Thanks for shopping at Cleanlinesurf.com!</p>
<p align="justify">&nbsp;</p>
</td>
<td background="{$ImagesDir}/newmenu_06.gif"><img src="images/space.gif" width="14" height="100%" /></td>
</tr>
<tr>
<td background="{$ImagesDir}/newmenu_07.gif"><img src="images/space.gif" width="14" height="14" /></td>
<td background="{$ImagesDir}/newmenu_08.gif"><img src="images/space.gif" width="100%" height="14" /></td>
<td background="{$ImagesDir}/newmenu_09.gif"><img src="images/space.gif" width="14" height="14" /></td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="5" align="center">
<tr>
<td width="100%" align="center"></td>
</tr>
</table>

boomobile 08-06-2008 02:08 PM

Re: How do I add Javascript?
 
Ok so I'm going another direction to add this little scroller. Here's the code I've written:

{literal}<iframe src="../mikescroll/scrolling_marque.html" width="480" height="100" align="center" scrolling="no" frameborder="0"></iframe>{/literal}

This includes my html file I made, that works correctly, but right now it loads up the customer index page. What is the correct way to point to my file?

The file is located: skin1/customer/main/mikescroll/scrolling_marque.html


Maybe I need to make a static page and call it? How would I write that using the code above?

boomobile 08-06-2008 02:40 PM

Re: How do I add Javascript?
 
So I'm able to make the scroller work on a static page, now how do I insert this static page into the index page? I don't want to use the include function, because it won't align where I want, so I'm thinking iframe, but my iframe code isn't pulling the correct page. I have literal brackets, still no go...

JWait 08-06-2008 05:02 PM

Re: How do I add Javascript?
 
Take a look at customer/main/welcome.tpl. It is what puts the "Welcome to..." at the start of the center section of the home page.... is that where you want your marquee?

boomobile 08-06-2008 10:33 PM

Re: How do I add Javascript?
 
I want the marquee to be placed just below the "Welcome to..."

boomobile 08-06-2008 10:47 PM

Re: How do I add Javascript?
 
This is my welcome.tpl I don't know how this will help me place the code...

{if ($active_modules.Greet_Visitor ne "") and ($smarty.cookies.GreetingCookie ne "") and $logout_user eq ''}
<H3>{$lng.lbl_welcome_back}, {$smarty.cookies.GreetingCookie|replace:"\'":"'"} </H3>
{else}
<H3>{$lng.lbl_welcome_to} { $config.Company.company_name }</H3>
<p>{/if}
{*{$lng.txt_welcome}*}</p>
<p>{include file="customer/main/homepage.tpl"} </p>
<P>
{if $active_modules.Bestsellers ne "" and $config.Modules.bestsellers_menu ne "Y"}
{include file="modules/Bestsellers/bestsellers.tpl"}
{/if}
<P>
{include file="customer/main/featured.tpl" f_products=$f_products}



homepage.tpl is the page i need to modify, I already know that, I just can't figure out the correct code...

JWait 08-11-2008 05:42 AM

Re: How do I add Javascript?
 
X-cart doesn't have a "homepage.tpl". If you want your marquee to be directly below "Welcome to..." or "Welcome back..." then either place your code, or insert an include (probably a better idea) in the area you have commented out ( {*{$lng.txt_welcome}*} ).

Also, there appears to be some formatting errors in your welcome.tpl. You have "open paragraph (<p>) statements without "close paragraph"statements, and 1 of these is within a "if" statement.

Code:

{if ($active_modules.Greet_Visitor ne "") and ($smarty.cookies.GreetingCookie ne "") and $logout_user eq ''}
<H3>{$lng.lbl_welcome_back}, {$smarty.cookies.GreetingCookie|replace:"\'":"'"} </H3>
{else}
<H3>{$lng.lbl_welcome_to} { $config.Company.company_name }</H3>
{/if}
<p>{*{$lng.txt_welcome}*}</p> <<< INSERT YOUR MARQUEE HERE
<p>{include file="customer/main/homepage.tpl"} </p> <<< WHAT IS THIS???

{if $active_modules.Bestsellers ne "" and $config.Modules.bestsellers_menu ne "Y"}
{include file="modules/Bestsellers/bestsellers.tpl"}
{/if}

{include file="customer/main/featured.tpl" f_products=$f_products}


boomobile 08-12-2008 12:27 PM

Re: How do I add Javascript?
 
I actually do have a "homepage.tpl" It is what controls the center section of the customer side. (where "welcome to" starts) I don't know if it was written specifically for our cart, I guess maybe it was since you say that x-cart dosen't have this file by default.
Anyway, I finally got it to work. I had too many lines and spaces in the code. It was breaking the page, so I condensed all the JS down to have no extra empty lines between the code. This is what I placed at the very top of the file
Quote:

{literal}
<!--------------BEGIN MIKES SCROLLER added on 8-8-2008------------>
<div id="tempholder"></div>
<script language="JavaScript" src="../scripts/dhtmllib.js"></script>
<script language="JavaScript" src="../scripts/scroller.js"></script>
<script language="JavaScript">
//-------------------------------------
//Mike's DHTML scroller (By Mike Hall)
//Last updated July 21st, 02' by Dynamic Drive for NS6 functionality
//For this and 100's more DHTML scripts, visit http://www.dynamicdrive.com
//-------------------------------------
//-------SET SCROLLER APPEARANCE AND MESSAGES-----------
var myScroller1 = new Scroller(0, 0, 530, 100, 1, 5); //(xpos, ypos, width, height, border, padding)
myScroller1.setColors("#006699", "#FFFFFF", "#efefef"); //(fgcolor, bgcolor, bdcolor)
myScroller1.setFont("Verdana,Arial,Helvetica", 2);
myScroller1.addItem("<p align='center'><span style='MikesScroll'><b>UGG&reg; Boots are in!</b><br><a href='home.php?cat=798'>UGG&reg; Classic Tall</a> &bull; <a href='home.php?cat=955'>UGG&reg; Classic Short</a> &bull; <a href='home.php?cat=1024'>Check them all out now!</a></span></p>");
myScroller1.addItem("<p align='center'><b>The all new Rip Curl E-Bombs are here!</b><br><a href='http://www.cleanlinesurf.com/home.php?cat=671'>E3: The third generation of Elastomax Superstretch Neoprene. Lighter, Warmer and More Flexible.</a></p>");
myScroller1.addItem("<p align='center'><b>Patagonia Wetsuits! Coming this fall!</b> <br><a href=''>The arrival is quickly approaching… Cleanlinesurf is one of only 10 US authorized dealers. Check out the construction here.</a></p>");
myScroller1.addItem("<p align='center'><b>The all new F-Bombs are here!</b><br><a href='http://www.cleanlinesurf.com/home.php?cat=2174'>Rip Curl F-Bomb Hooded Wetsuits with Fireskin lining! New and improved for Fall 08. Still the warmest available.</a></p>");
myScroller1.addItem("<p align='center'><b>On Sale Now:</b><br><a href='http://www.cleanlinesurf.com/home.php?cat=625'>&bull; O'neill Hammer 3/2 - $99.96</a><br><a href='http://www.cleanlinesurf.com/product.php?productid=25152&cat=1311'>&bull; Billabong Foil GBS - $103.16</a><br><a href='http://www.cleanlinesurf.com/product.php?productid=28495'>&bull; Billabong Foil FL - $77.56</a></p>");
//----------SET SCROLLER PAUSE------------------
myScroller1.setPause(4000); //set pause beteen msgs, in milliseconds
function runmikescroll() {
var layer;
var mikex, mikey;
//----------LOCATE PLACEHOLDER layer so we can use it to position the scrollers.------------
layer = getLayer("placeholder");
mikex = getPageLeft(layer);
mikey = getPageTop(layer);
//-----------CREATE the first scroller and position it.--------
myScroller1.create();
myScroller1.hide();
myScroller1.moveTo(mikex, mikey);
myScroller1.setzIndex(100);
myScroller1.show();
}
window.onload=runmikescroll
</script>
<div id="placeholder" style="position:relative; width:530; height:100px;"> </div>
<!------------END MIKES SCROLLER------------->
{/literal}

boomobile 08-12-2008 12:36 PM

Re: How do I add Javascript?
 
I would like to do an include, but I'm not sure what to save the file I'm going to include as. Can I just make it a html?

If I was to include it where you say, I think it will spread across the entire white section, and that's not what I want. I want to add a flash to go there. The marquee is where I want it right now.


All times are GMT -8. The time now is 08:06 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.