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

Embedded page with dynamic data problem

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 08-26-2007, 03:52 PM
 
sjbt sjbt is offline
 

Advanced Member
  
Join Date: Jun 2007
Posts: 35
 

Default Embedded page with dynamic data problem

I have an app that I'm trying to bring in using an embedded page. This pulls data in from a MySQL database totally separate from X-Cart. I have the whole script (PHP + Javascript) wrapped with the {literal}{/literal} tags. The data doesn't display.

I put the script into a php test file in the same directory and it works fine. Is something in Smarty preventing the access to the database? What would you suggest?

I already set all the variable global at the top and I changed the variables for username, password, etc to a slightly different word so it wouldn't be a conflict.

Sure appreciate any help.

Thanks!!!
__________________
X-Cart 4.1.8
Reply With Quote
  #2  
Old 08-26-2007, 08:42 PM
 
inebriate inebriate is offline
 

eXpert
  
Join Date: May 2006
Posts: 301
 

Default Re: Embedded page with dynamic data problem

what is the layout of the code? are you passing php variables to javascript, javascript to php, smarty to javascript, etc
__________________
x-cart pro 4.0.18
linux
www.fabric8d.com (currently undergoing construction)
Reply With Quote
  #3  
Old 08-27-2007, 11:31 AM
 
sjbt sjbt is offline
 

Advanced Member
  
Join Date: Jun 2007
Posts: 35
 

Default Re: Embedded page with dynamic data problem

I'm passing php variables to javascript so that within the javascript there are php tags with while loops, then back to js, then pull in x1 php variable, back to js, pull in x2 php variable, etc. It's messy. But I inherited it and it works outside of X-Cart/Smarty.

I've got it to show the basic data now but part of the function is that a choice in one field updates another field (onchange). That part is not working. Is X-Cart preventing an onchange event or is something in the function being interefered with?

This line:
<select name="itemlist" size="10" onchange="chlist()">

Is calling this js function:
function chlist()
{
e=document.orderfrm;
var p=e.itemlist.selectedIndex;
e.prodid.value=pid[p];
e.desc.value=pdesc[p];
e.amount.value=pprice[p];
if(p==0)
{
alert("Please select an Item");
return false;
}
}
__________________
X-Cart 4.1.8
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 01:11 PM.

   

 
X-Cart forums © 2001-2020