View Single Post
  #8  
Old 12-16-2011, 06:40 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,201
 

Default Re: What is the Smarty variable for Provider company name?

Quote:
Originally Posted by jake8804
I am making some progress on understanding this system of web design . I COULD run an SQL query directly from the template right now and get the info that way but that is undesirable, yes?

The query will be something like:

SELECT customers.company
FROM customers
JOIN products
ON customers.provider = products.provider;

And then the Smarty assign is:

$smarty->assign('company',$product);

How do I put them together?
Also, I have been trying to figure out which .php file to use to assign variables to $product...which one is it? I am more of a database guy than a web designer lol

Don't run php code from within the templates - bad practice and slows down everything. You need to find the function that puts the product info together in include/func/func.product.php and modify the query that gets all product info together (or add new one) to include provider's name. No need for other changes or smarty assigns - everythign is done for you by the function and the info will just add to $product array and eventually to $products array on products list pages
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote