Post by theme » Wed Mar 16, 2016 1:47 pm

I'am using opencart version 2.2.0.0
In .tpl file want route, have written code as bellow

Code: Select all

$this->request->get['route']; 
but m getting following error
Notice: Undefined property: Template\BasicOverride::$request /template/common/column_right.tpl

how to use $this->request->get['route']; in .tpl file?

Newbie

Posts

Joined
Thu Mar 10, 2016 5:23 pm

Post by pm-netti » Wed Mar 16, 2016 4:08 pm

theme wrote:I'am using opencart version 2.2.0.0
In .tpl file want route, have written code as bellow

Code: Select all

$this->request->get['route']; 
but m getting following error
Notice: Undefined property: Template\BasicOverride::$request /template/common/column_right.tpl

how to use $this->request->get['route']; in .tpl file?
This can do variable to common/colum_right.php, eg:

Code: Select all

if (isset($this->request->get['route'])) {
  $route = (string)$this->request->get['route'];
  $data['route'] = (string)$this->request->get['route'];
} else {
  $route = 'common/home';
  $data['route'] = 'common/home';
}

Image
- - - OpenCart Upgrade Service - - -


User avatar
Active Member

Posts

Joined
Sat Apr 07, 2012 11:22 pm
Location - Kittilä-Finland
Who is online

Users browsing this forum: No registered users and 15 guests