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)
-   -   fatal error with embbeded page (https://forum.x-cart.com/showthread.php?t=9371)

bigspooner 09-15-2004 07:40 AM

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 !!!!!!

bigspooner 09-15-2004 07:58 AM

ok now have wrapped javascript inside literal tags.....page now displays...but calculator does not calculate!!!

bigspooner 09-15-2004 11:56 PM

BTT Bump !!...please help!!!!

shan 09-16-2004 04:08 AM

did you check the setting to allow smarty tags in embedded pages ?

adpboss 09-16-2004 04:49 AM

Please post code inside of code tags. It makes it so much easier to read, and thus easier to get help.

bigspooner 09-16-2004 05:24 AM

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


ADP...sorry mate I am not sure what your talking about??, what tags?

adpboss 09-16-2004 05:33 AM

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.

adpboss 09-16-2004 05:34 AM

In version 4.0.x it is in general settings, about 8 up from the bottom.

bigspooner 09-16-2004 07:16 AM

oh i see, sorry about that.

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

Scott

bigspooner 09-16-2004 07:19 AM

its version 3.5.9 btw

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

Is that correct?

scott


All times are GMT -8. The time now is 06:52 AM.

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