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)
-   -   Passing $variable but won't display on page? (https://forum.x-cart.com/showthread.php?t=29564)

pdheady 03-09-2007 12:16 PM

Passing $variable but won't display on page?
 
I'm doing a post with the following:

<input type="hidden" name="popcart" value="1">

It then redirects back to the same page and in the url it is passing the variable popcart=1 in the browser header successfully

I then call the following which fails

{if $popcart eq "1"}
<script language="JavaScript" src="/popup/minicart_adplib.js"></script>
<script language="JavaScript" src="/popup/minicart.js"></script>
<body onload="show('template01');return true;"></body>
{/if}

I even tried outputting the variable to see if it will post but the system doesn't seem to grab the variables that I assign. Is there something I need to do?

<h2>{$popcart}</h2> <== no output

inebriate 03-09-2007 12:24 PM

Re: Passing $variable but won't display on page?
 
when you put things in braces, its a smarty variable which is not the same as a html value

pdheady 03-09-2007 12:26 PM

Re: Passing $variable but won't display on page?
 
ok thanks

pdheady 03-09-2007 12:28 PM

Re: Passing $variable but won't display on page?
 
How do i assign a html variable to a smarty variable ?

pdheady 03-09-2007 12:43 PM

Re: Passing $variable but won't display on page?
 
Ok I found out how to do it in the home.php file.

$smarty->assign("popcart",$popcart);


All times are GMT -8. The time now is 01:20 PM.

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