Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

How do I add Javascript?

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #31  
Old 08-06-2008, 10:47 PM
  boomobile's Avatar 
boomobile boomobile is offline
 

eXpert
  
Join Date: Oct 2007
Posts: 306
 

Default 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...
__________________
X Cart Ver: 4.0.14
MySQL4 4.1.22
phpMyAdmin 2.6.0
Pearl 5.6.0
PHP 5.2.1
Python 2.2.2
Server: Apache/2.0.52 (Red Hat)
OS: Linux
www.cleanlinesurf.com
1. Customer Rewards Points
2. One Page Checkout (altercart)
3. Free shipping orders over $50 as Real Time Shipping
4. Gift Certificates
-----------------------------------------------
Graphic Design | Boomobile Design, LLC
www.boomobile.com
Reply With Quote
  #32  
Old 08-11-2008, 05:42 AM
  JWait's Avatar 
JWait JWait is offline
 

X-Man
  
Join Date: Nov 2005
Location: California
Posts: 2,440
 

Default 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}
__________________
Two Separate X-Cart Stores
Version 4.4.4 Gold - X-AOM - Vivid Dreams Aquamarine (modified) - Linux
Mods - Newest Products - View All -, and a few others. Numerous upgrades from 4.0.x series.
Integrated with Stone Edge Order Manager + POS

Version 4.1.12 Gold (fresh install) - X-AOM - Linux
Mods - XCSEO free
Reply With Quote
  #33  
Old 08-12-2008, 12:27 PM
  boomobile's Avatar 
boomobile boomobile is offline
 

eXpert
  
Join Date: Oct 2007
Posts: 306
 

Default 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}
__________________
X Cart Ver: 4.0.14
MySQL4 4.1.22
phpMyAdmin 2.6.0
Pearl 5.6.0
PHP 5.2.1
Python 2.2.2
Server: Apache/2.0.52 (Red Hat)
OS: Linux
www.cleanlinesurf.com
1. Customer Rewards Points
2. One Page Checkout (altercart)
3. Free shipping orders over $50 as Real Time Shipping
4. Gift Certificates
-----------------------------------------------
Graphic Design | Boomobile Design, LLC
www.boomobile.com
Reply With Quote
  #34  
Old 08-12-2008, 12:36 PM
  boomobile's Avatar 
boomobile boomobile is offline
 

eXpert
  
Join Date: Oct 2007
Posts: 306
 

Default 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.
__________________
X Cart Ver: 4.0.14
MySQL4 4.1.22
phpMyAdmin 2.6.0
Pearl 5.6.0
PHP 5.2.1
Python 2.2.2
Server: Apache/2.0.52 (Red Hat)
OS: Linux
www.cleanlinesurf.com
1. Customer Rewards Points
2. One Page Checkout (altercart)
3. Free shipping orders over $50 as Real Time Shipping
4. Gift Certificates
-----------------------------------------------
Graphic Design | Boomobile Design, LLC
www.boomobile.com
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 12:40 PM.

   

 
X-Cart forums © 2001-2020