How to hide logo in product page in Open Cart?

128 views Asked by At

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

1

There are 1 answers

3
DigitCart On

You can use route, in catalog/controller/common/header.php find:

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

before or after it add:

$data['logo'] = '';

tested on opencart 2.3.0.2