In case anyone else needs to do this in future, here is how I copied the Information pages lists into the menu bar (to work as a drop down list similar to the products).
This is based on a v1.5.0 installation:
Copy the following from the footer controller file: opencart/catalog/controller/common/footer.php
Code: Select all
$this->language->load('common/footer');
$this->data['text_information'] = $this->language->get('text_information');
$this->data['text_service'] = $this->language->get('text_service');
$this->data['text_extra'] = $this->language->get('text_extra');
$this->data['text_account'] = $this->language->get('text_account');
$this->data['text_contact'] = $this->language->get('text_contact');
$this->data['text_return'] = $this->language->get('text_return');
$this->data['text_sitemap'] = $this->language->get('text_sitemap');
$this->data['text_manufacturer'] = $this->language->get('text_manufacturer');
$this->data['text_voucher'] = $this->language->get('text_voucher');
$this->data['text_affiliate'] = $this->language->get('text_affiliate');
$this->data['text_special'] = $this->language->get('text_special');
$this->data['text_login'] = $this->language->get('text_login');
$this->data['text_order'] = $this->language->get('text_order');
$this->data['text_wishlist'] = $this->language->get('text_wishlist');
$this->data['text_newsletter'] = $this->language->get('text_newsletter');
$this->load->model('catalog/information');
$this->data['informations'] = array();
foreach ($this->model_catalog_information->getInformations() as $result) {
$this->data['informations'][] = array(
'title' => $result['title'],
'href' => $this->url->link('information/information', 'information_id=' . $result['information_id'])
);
}
$this->data['contact'] = $this->url->link('information/contact');
$this->data['return'] = $this->url->link('account/return/insert', '', 'SSL');
$this->data['sitemap'] = $this->url->link('information/sitemap');
$this->data['manufacturer'] = $this->url->link('product/manufacturer', '', 'SSL');
$this->data['voucher'] = $this->url->link('checkout/voucher', '', 'SSL');
$this->data['affiliate'] = $this->url->link('affiliate/account', '', 'SSL');
$this->data['special'] = $this->url->link('product/special');
$this->data['login'] = $this->url->link('account/login', '', 'SSL');
$this->data['order'] = $this->url->link('account/order', '', 'SSL');
$this->data['wishlist'] = $this->url->link('account/wishlist', '', 'SSL');
$this->data['newsletter'] = $this->url->link('account/newsletter', '', 'SSL');
$this->data['powered'] = sprintf($this->language->get('text_powered'), $this->config->get('config_name'), date('Y', time()));
if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/common/footer.tpl')) {
$this->template = $this->config->get('config_template') . '/template/common/footer.tpl';
} else {
$this->template = 'default/template/common/footer.tpl';
}
$this->render();
And insert it into the top (line 4 onwards in v1.5.0) of opencart/catalog/controller/common/header.php after the following lines:
Code: Select all
<?php
class ControllerCommonHeader extends Controller {
protected function index() {
Save the file.
Now amend the header.tpl in your theme and add the following section where you need the Information list to appear. Note the code here was added after the
to make the Information list appear in the menu bar as a drop-down. Alter the ul and li tags if you need it to display differently elsewhere:
Code: Select all
<ul>
<li>
<a href="#"><?php echo $text_information; ?></a>
<div>
<ul><?php foreach ($informations as $information) { ?>
<li>
<a href="<?php echo $information['href']; ?>"><?php echo $information['title']; ?></a>
</li>
<?php } ?>
</ul>
</li>
</ul>
That should be it, the Information pages should be in the relevant place and can now be styled at will with CSS.