0

I need to hide logo in product page. Logo is placed in header HTML.

So, I tried to add new variable $data['product_page_logo'] in header.php controller before loading template like as:

$data['product_page_logo'] = false;

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

After in header.tpl I check this variable:

<? if(isset($data['product_page_logo']) && $data['product_page_logo'] == false) {
    echo "Logo";
}?>

But it does not work, I get error undefined variable product_page_logo

4

1 回答 1

1

您可以routecatalog/controller/common/header.php查找中使用 ,:

$class = '-' . $this->request->get['product_id'];

在它之前或之后添加:

$data['logo'] = '';

在 opencart 2.3.0.2 上测试

于 2017-01-09T16:11:32.780 回答