I'm working with a shopping cart (CS-cart) that uses smarty templates. Products are associated with a brand. When the product page renders i'm able to get the brand ID.
I also have custom .tpl files such as brand1.tpl brand2.tpl where the number represents the row id from the db table.
If I have the brand ID in a variable, would someone show me an example of how to include the custom template and dynamically use the brand ID variable in place of the number in the file name being included. Something like below but I don't think $bid is a way to insert the variable. Any help is appreciated
Thanks
{include file='brand$bid.tpl'}
try to use double quotes Example
{* body of template goes here, the $tpl_name variable
is replaced with a value eg 'contact.tpl'
*}
{include file="$tpl_name.tpl"}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With