I am using Opencart Version 2.0.3.1.
I have to create new page in Opencart. But I don't know how to start. So I followed the given link http://forum.opencart.com/viewtopic.php?t=6253 to create custom page.
But I got the error
Fatal error: Cannot access private property Document::$title in C:\wamp\www\opencart\catalog\controller\custom\service.php on line 6
As mentioned in the link,I created three files are:
catalog/controller/custom/service.php
class ControllerCustomService extends Controller {
public function index() {
$this->language->load('custom/service');
$this->document->title = $this->language->get('heading_title');
$this->document->breadcrumbs = array();
$this->document->breadcrumbs[] = array(
'href' => $this->url->http('common/home'),
'text' => $this->language->get('text_home'),
'separator' => FALSE
);
$url = '';
if (isset($this->request->get['page'])) {
$url .= '&page=' . $this->request->get['page'];
}
$this->document->breadcrumbs[] = array(
'href' => $this->url->http('custom/service' . $url),
'text' => $this->language->get('heading_title'),
'separator' => $this->language->get('text_separator')
);
$this->data['heading_title'] = $this->language->get('heading_title');
$this->data['heading_text'] = $this->language->get('heading_text');
$this->id = 'content';
$this->template = $this->config->get('config_template') . 'custom/service.tpl';
$this->layout = 'common/layout';
$this->render();
}
}
catalog/view/theme/default/template/custom/service.tpl
<div class="top">
<h1><?php echo $heading_title; ?></h1>
</div>
<div class="middle">
<div><?php echo $heading_text; ?></div>
</div>
<div class="bottom"> </div>
catalog/language/custom/service.php
// Heading
$_['heading_title'] = 'Our Services';
//Content
$_['heading_text'] = 'Welcome to our services';
Also I tried the fixes mentioned in that link, but no luck.
So someone please help me to fix the problems... Any help is really appreciable ..