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

Passing $variable but won't display on page?

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 03-09-2007, 12:16 PM
 
pdheady pdheady is offline
 

Advanced Member
  
Join Date: Mar 2007
Location: West Palm Beach, FL
Posts: 36
 

Default 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
__________________
Xcart 4.0.19
Reply With Quote
  #2  
Old 03-09-2007, 12:24 PM
 
inebriate inebriate is offline
 

eXpert
  
Join Date: May 2006
Posts: 301
 

Default 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
__________________
x-cart pro 4.0.18
linux
www.fabric8d.com (currently undergoing construction)
Reply With Quote
  #3  
Old 03-09-2007, 12:26 PM
 
pdheady pdheady is offline
 

Advanced Member
  
Join Date: Mar 2007
Location: West Palm Beach, FL
Posts: 36
 

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

ok thanks
__________________
Xcart 4.0.19
Reply With Quote
  #4  
Old 03-09-2007, 12:28 PM
 
pdheady pdheady is offline
 

Advanced Member
  
Join Date: Mar 2007
Location: West Palm Beach, FL
Posts: 36
 

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

How do i assign a html variable to a smarty variable ?
__________________
Xcart 4.0.19
Reply With Quote
  #5  
Old 03-09-2007, 12:43 PM
 
pdheady pdheady is offline
 

Advanced Member
  
Join Date: Mar 2007
Location: West Palm Beach, FL
Posts: 36
 

Default 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);
__________________
Xcart 4.0.19
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 04:11 PM.

   

 
X-Cart forums © 2001-2020