Opencart バージョン 2.0.3.1を使用しています。
Opencart で新しいページを作成する必要があります。でも、どうやって始めたらいいのかわからない。そこで、指定されたリンクhttp://forum.opencart.com/viewtopic.php?t=6253に従ってカスタムページを作成しました。
しかし、私はエラーが発生しました
致命的なエラー: 6 行目の C:\wamp\www\opencart\catalog\controller\custom\service.php のプライベート プロパティ Document::$title にアクセスできません
リンクで述べたように、次の 3 つのファイルを作成しました。
カタログ/コントローラー/カスタム/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();
}
}
カタログ/ビュー/テーマ/デフォルト/テンプレート/カスタム/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>
カタログ/言語/カスタム/service.php
// Heading
$_['heading_title'] = 'Our Services';
//Content
$_['heading_text'] = 'Welcome to our services';
また、そのリンクに記載されている修正を試みましたが、うまくいきませんでした。
だから誰かが問題を解決するのを手伝ってください...どんな助けも本当にかなり..