Hi, I'm new to opencart and have a basic question about the core of opencart.
Can anybody tell me how is the variable being pass to tpl?
on the tpl files, I see alot of $variable but have no idea where they come from.
thanks!
-Ken
This is an example of how to do it:
http://forum.opencart.com/viewtopic.php ... 60#p146671
Basically you create the variable in the controller file that calls the tpl file
Ex
Then in the tpl file you would call
http://forum.opencart.com/viewtopic.php ... 60#p146671
Basically you create the variable in the controller file that calls the tpl file
Ex
Code: Select all
$this->data['xyz'] = '123';
Code: Select all
<?php echo $xyz; ?>
Hi Qphoria,
I'm using Opencart 1.5.4.
I need to echo $link['href'] within product.tpl.
Just type echo $link['href'] in the product.tpl will echo nothing.
We can easily echo $link['href'] in header.tpl, like this code (for canonical link):
How to echo it in product.tpl?
Thank you..
I'm using Opencart 1.5.4.
I need to echo $link['href'] within product.tpl.
Just type echo $link['href'] in the product.tpl will echo nothing.
We can easily echo $link['href'] in header.tpl, like this code (for canonical link):
Code: Select all
<link href="<?php echo $link['href']; ?>" rel="<?php echo $link['rel']; ?>" />
Thank you..
Who is online
Users browsing this forum: No registered users and 112 guests