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

fatal error with embbeded page

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 09-15-2004, 07:40 AM
 
bigspooner bigspooner is offline
 

Advanced Member
  
Join Date: Apr 2004
Location: berkshire uk
Posts: 44
 

Default fatal error with embbeded page

Hello

I am trying to get a java scripted vat calculator to sit in the centre box of my xcart.

I created an embedded page then put my code in after, and ftpd it back.

The error i get when i click the link on my site is:

============================================
Fatal error: Smarty: [in evaluated template line 5]: syntax error: expecting '=' after attribute name 'var' (Smarty_Compiler.class.php, line 1350) in /home/uxwywjo/public_html/shop/Smarty-2.5.0/Smarty_Compiler.class.php on line 1832
============================================



Heres the code for the calculator:
=============================================
<html><head>

<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function doMath() {
var one = eval(document.myform.total.value)
var two = eval(document.myform.vat.value)
var prod = one * two
document.myform.amount.value=custRound(prod,2);
}

function custRound(x,places) {
return (Math.round(x*Math.pow(10,places)))/Math.pow(10,places)
}

// End -->
</SCRIPT>
</head>

<body>
<CENTER>
<FORM NAME="myform">
<table border="2" bordercolor="#000080" bgcolor="E0F3FC">
<tr>
<td bordercolor="E0F3FC"><font color="#000080" face="Verdana">Total Excluding VAT</font></td>
<td bordercolor="E0F3FC">
<input type="text" size="10" style="BORDER-RIGHT: #052067 1px solid; BORDER-TOP: #052067 1px solid; BORDER-LEFT: #052067 1px solid; BORDER-BOTTOM: #052067 1px solid;"class="text" name="total">
</td>
</tr>
<tr>
<td bordercolor="E0F3FC" bordercolor="E0F3FC"><font color="#000080" face="Verdana">VAT rate</font></td>
<td bordercolor="E0F3FC">

<input type="text" size="10" value="1.175" style="BORDER-RIGHT: #052067 1px solid; BORDER-TOP: #052067 1px solid; BORDER-LEFT: #052067 1px solid; BORDER-BOTTOM: #052067 1px solid;"class="text" name="vat">


</td>
</tr>
<tr>
<td bordercolor="E0F3FC"><font color="#000080" face="Verdana">Total Including VAT</font></td>
<td bordercolor="E0F3FC">
<input type="text" size="10" style="BORDER-RIGHT: #052067 1px solid; BORDER-TOP: #052067 1px solid; BORDER-LEFT: #052067 1px solid; BORDER-BOTTOM: #052067 1px solid;"class="text" name="amount">
</td>
</tr>
<tr>
<td> </td>
<td bordercolor="E0F3FC">

<input type="button" value="Calculate" onClick="doMath()" name="button" style="background:
052067; color: yellow; font-size: 0.9 em; font-face: verdana" class="button">
</td>
</tr>
<tr><td bordercolor="E0F3FC"></td></tr>

<tr></td><td bordercolor="E0F3FC" align="left"></td></tr>
</table>
</FORM>

<table border="2" bordercolor="#000080" bgcolor="E0F3FC">
<tr>
<td bordercolor="E0F3FC" width=253><font color="#000080" face="Verdana" size="-2">To calculate the VAT on any given amount
simply type that amount in the top box then click the 'calculate' button.


</font></td>
</td></tr>

</CENTER>



</body>


</html>
===========================================

Any ideas please?....Help !!!!!!
Reply With Quote
  #2  
Old 09-15-2004, 07:58 AM
 
bigspooner bigspooner is offline
 

Advanced Member
  
Join Date: Apr 2004
Location: berkshire uk
Posts: 44
 

Default

ok now have wrapped javascript inside literal tags.....page now displays...but calculator does not calculate!!!
Reply With Quote
  #3  
Old 09-15-2004, 11:56 PM
 
bigspooner bigspooner is offline
 

Advanced Member
  
Join Date: Apr 2004
Location: berkshire uk
Posts: 44
 

Default

BTT Bump !!...please help!!!!
Reply With Quote
  #4  
Old 09-16-2004, 04:08 AM
  shan's Avatar 
shan shan is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Birmingham, UK
Posts: 6,163
 

Default

did you check the setting to allow smarty tags in embedded pages ?
__________________
Looking for a reliable X-cart host ?
You wont go wrong with either of these.

EWD Hosting
Hands On Hosting
Reply With Quote
  #5  
Old 09-16-2004, 04:49 AM
  adpboss's Avatar 
adpboss adpboss is offline
 

X-Man
  
Join Date: Feb 2003
Location: Ontario, Canada
Posts: 2,389
 

Default

Please post code inside of code tags. It makes it so much easier to read, and thus easier to get help.
Reply With Quote
  #6  
Old 09-16-2004, 05:24 AM
 
bigspooner bigspooner is offline
 

Advanced Member
  
Join Date: Apr 2004
Location: berkshire uk
Posts: 44
 

Default

hello shan...no i didnt...where is it please?!!


ADP...sorry mate I am not sure what your talking about??, what tags?
Reply With Quote
  #7  
Old 09-16-2004, 05:33 AM
  adpboss's Avatar 
adpboss adpboss is offline
 

X-Man
  
Join Date: Feb 2003
Location: Ontario, Canada
Posts: 2,389
 

Default

When you post, highlight the code areas and click the "code" formatting button.

It will wrap your text like this

Code:
CODE

I'm checking to find the setting but if you would post your version # in your signature, it would help me look in the correct version.
Reply With Quote
  #8  
Old 09-16-2004, 05:34 AM
  adpboss's Avatar 
adpboss adpboss is offline
 

X-Man
  
Join Date: Feb 2003
Location: Ontario, Canada
Posts: 2,389
 

Default

In version 4.0.x it is in general settings, about 8 up from the bottom.
Reply With Quote
  #9  
Old 09-16-2004, 07:16 AM
 
bigspooner bigspooner is offline
 

Advanced Member
  
Join Date: Apr 2004
Location: berkshire uk
Posts: 44
 

Default

oh i see, sorry about that.

Thanks for the advice people, much appreciated, off to give it a try.

Scott
Reply With Quote
  #10  
Old 09-16-2004, 07:19 AM
 
bigspooner bigspooner is offline
 

Advanced Member
  
Join Date: Apr 2004
Location: berkshire uk
Posts: 44
 

Default

its version 3.5.9 btw

I have this ticked: Parse Smarty tags in the content of embedded static pages:

Is that correct?

scott
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 06:58 AM.

   

 
X-Cart forums © 2001-2020