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)
-   -   Embedded page with dynamic data problem (https://forum.x-cart.com/showthread.php?t=33497)

sjbt 08-26-2007 03:52 PM

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. :mrgreen:

Thanks!!!

inebriate 08-26-2007 08:42 PM

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

sjbt 08-27-2007 11:31 AM

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;
}
}


All times are GMT -8. The time now is 08:50 AM.

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