D
D
Dmitry Demidenko2017-09-12 21:28:02
CMS
Dmitry Demidenko, 2017-09-12 21:28:02

Separate template for opencart text page?

Hello)
The question is most likely stupid, but still do not judge the beginner.
How to make a separate page, for example "Shipping and payment" and link it to a separate template.
Maybe there are some free modules?
help me please)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Z
zoozag, 2017-09-18
@detriat

See controller information/information
There look for lines like:

if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/information/information.tpl')) {
        $this->response->setOutput($this->load->view($this->config->get('config_template') . '/template/information/information.tpl', $data));
      } else {
        $this->response->setOutput($this->load->view('default/template/information/information.tpl', $data));
      }

You need to add a check on $information_id to this condition. more or less like this:
if ($information_id == {id нужной статьи}) {
  if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/information/information.tpl')) {
    $this->response->setOutput($this->load->view($this->config->get('config_template') . '/template/information/{новое название шаблона}.tpl', $data));
  } else {
    $this->response->setOutput($this->load->view('default/template/information/{новое название шаблона}.tpl', $data));
  }
} else {
  if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/information/information.tpl')) {
    $this->response->setOutput($this->load->view($this->config->get('config_template') . '/template/information/information.tpl', $data));
  } else {
    $this->response->setOutput($this->load->view('default/template/information/information.tpl', $data));
  }
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question