Page 1 of 1

Questions regarding include() function

Posted: Mon Nov 28, 2011 12:08 pm
by gosulove
I am trying to modify the login.tpl such that I want the header.tpl to be header2.tpl . So i replace <?php echo $header; ?> with <?php include('catalog/view/theme/default/template/account/header2.tpl'); ?> . However, it doesn't work..... Anyone can help? what is the correct coding for including such file? Thx in advance

Re: Questions regarding include() function

Posted: Mon Nov 28, 2011 12:51 pm
by Qphoria
1. EDIT: catalog/controller/common/header.php

2. FIND (Multiple times):

Code: Select all

if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/common/header.tpl')) {
    $this->template = $this->config->get('config_template') . '/template/common/header.tpl';
} else {
    $this->template = 'default/template/common/header.tpl';
} 
3. REPLACE WITH:

Code: Select all

if (isset($this->request->get['route']) && $this->request->get['route'] == 'account/login') {
    if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/common/header2.tpl')) {
        $this->template = $this->config->get('config_template') . '/template/common/header2.tpl';
    } else {
        $this->template = 'default/template/common/header2.tpl';
    }
} else {
    if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/common/header.tpl')) {
        $this->template = $this->config->get('config_template') . '/template/common/header.tpl';
    } else {
        $this->template = 'default/template/common/header.tpl';
    }
} 

Re: Questions regarding include() function

Posted: Mon Nov 28, 2011 3:45 pm
by gosulove
Thx!!! You are so awesome!! ;)