Post by justint24 » Tue Jan 09, 2018 4:55 am

Hi,

I'm trying to create a different header for my checkout compared to the rest of the site, initially i'm trying to remove the navigation menu on the header in checkout, i think the easiest way to do this is to create a new header for the checkout.

I have this code from an old post

if (!isset($this->request->get['route']) || (isset($this->request->get['route']) && ($this->request->get['route'] == 'checkout/checkout'))) {
if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/common/headercheckout.tpl')) {
$this->template = $this->config->get('config_template') . '/template/common/headercheckout.tpl';
} else {
$this->template = 'default/template/common/headercheckout.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';
}
}

and this is the code at the end of my header.tpl file

$data['language'] = $this->load->controller('common/language');
$data['currency'] = $this->load->controller('common/currency');
$data['search'] = $this->load->controller('common/search');
$data['cart'] = $this->load->controller('common/cart');

// For page specific css
if (isset($this->request->get['route'])) {
if (isset($this->request->get['product_id'])) {
$class = '-' . $this->request->get['product_id'];
} elseif (isset($this->request->get['path'])) {
$class = '-' . $this->request->get['path'];
} elseif (isset($this->request->get['manufacturer_id'])) {
$class = '-' . $this->request->get['manufacturer_id'];
} elseif (isset($this->request->get['information_id'])) {
$class = '-' . $this->request->get['information_id'];
} else {
$class = '';
}

$data['class'] = str_replace('/', '-', $this->request->get['route']) . $class;
} else {
$data['class'] = 'common-home';
}

return $this->load->view('common/header', $data);
}
}

How can i implement the change within the header.tpl file?

If it helps i am using OC 2.3.0.2 with journal2 theme.

Many thanks

New member

Posts

Joined
Mon Oct 27, 2014 12:49 am

Post by thekrotek » Tue Jan 09, 2018 5:09 am

The easiest way is to use CSS. Always. Just set "display: none" to all elements you want to hide and sleep well.

Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com


User avatar
Expert Member

Posts

Joined
Sun Jul 03, 2016 12:24 am


Post by justint24 » Wed Jan 10, 2018 2:40 pm

Thank you, i understand display:none; but how do i hide the navigation menu just on checkout page but keep it visible on all other pages?

New member

Posts

Joined
Mon Oct 27, 2014 12:49 am
Who is online

Users browsing this forum: No registered users and 14 guests