View Single Post
  #1  
Old 11-22-2002, 07:44 AM
 
AJ AJ is offline
 

Member
  
Join Date: Oct 2002
Location: Marietta, Ohio
Posts: 25
 

Default Passing Smarty Variables to PHP?

Okay, I've been using the following method to include my own PHP files in Smarty .tpl template files:

{include_php file="/pathtofile/file.php"}

Now I have another problem. How in the WORLD do you pass a variable from the .tpl file to the included PHP file????

In my /skin1/main/customer/main/products.tpl file, I want to include a php file that contains some custom mysql queries. All I need to do, is pass the productid variable to this included file. I cannot do it to save my life. After hours of experimenting and research in newsgroups, etc, it is becoming painfully apparent that while PHP can send variables TO Smarty, it cannot receive variables FROM Smarty.

<rant>
This is another prime example why I think the "customizability" of X-Cart is really misrepresented. If Smarty and PHP can't talk to each other, what is the point? If X-Cart were 100% PHP, I could have accomplished this customization in twenty minutes. Instead, I've spent over five hours on it with no resolution, including the time spent posting this message.
</rant>
__________________
Andrew
Webdev/Designer/Filmmaker
http://www.jstudios.com
Reply With Quote