Post by asimons999 » Mon Feb 16, 2009 2:45 pm

Gday.

How come when I copy and paste $variable elements to another template file, it says the variable isn't defined? Is something dynamically setting and unset()ing them in a way to stop other template files from being able to access that data?

Newbie

Posts

Joined
Mon Feb 16, 2009 2:30 pm

Post by fido-x » Mon Feb 16, 2009 5:39 pm

Basically, there are 3 files you need to look at -- the controller file, the language file and the template file.

The variable is declared in the controller and passed through to the template, while the value of the variable may come from the language file or extracted from the database.

Have a look in the controller file with the same name as the template file, you will find something like --

Code: Select all

$this->data['variable_name'] = $this->language->get['variable_name'];
And in the associated language file --

Code: Select all

$_['variable_name'] = 'Some value';
Fido-X.

Image
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool

If you're not living on the edge ... you're taking up too much space!


User avatar
Expert Member

Posts

Joined
Sat Jun 28, 2008 1:09 am
Location - Tasmania, Australia
Who is online

Users browsing this forum: No registered users and 93 guests