Opencart Custom Work - View All
Opencart Installation
If you don't know how or you just need someone else to install and configure Opencart for you, just contact us and we will discuss the details.
Custom Design and Coding
We design your website frontend and code it into Opencart. You get the template installed on your website, PSD design files and template files.
Design Coding
We code a custom design into Opencart or we transfer your old shop/website design to Opencart. Click the title to see the prices
Convert Your Current Theme to Responsive
We will convert your current Opencart Template to be responsive. We will also provide you the template files.
Opencart Transfer
We will transfer your opencart shop to another hosting/domain. Contact us and provide the required temporary login information and we can start

HOW TO - Information & Contact Links in Opencart's Menu

Here is a small tutorial if you want to add "Contact Us" and "Information" links in the Opencart's header menu. VQMod provided.

I will start by saying that you need to edit one Opencart controller file and one theme file.

The tutorial is based on the default template, Opencart version 1.5.6.1. Should work on 1.5.3x, 1.5.4.x and 1.5.5.x.

VQMod XML file available HERE (the modifications are done through vqmod, and you don't need to edit any files. Just copy the XML file inside /vqmod/xml)

1) First, open the controller file

catalog/controller/common/header.php

and add

$this->language->load('common/footer');
            $this->data['contact'] = $this->url->link('information/contact');
            $this->data['text_information'] = $this->language->get('text_information');
            $this->data['text_contact'] = $this->language->get('text_contact');
            $this->load->model('catalog/information');
            $this->data['informations'] = array();
            foreach ($this->model_catalog_information->getInformations() as $result) {
                if ($result['bottom']) {
                    $this->data['informations'][] = array(
                        'title' => $result['title'],
                        'href'  => $this->url->link('information/information', 'information_id=' . $result['information_id'])
                    );
                }
            }

let's say after:

$this->data['checkout'] = $this->url->link('checkout/checkout', '', 'SSL');

 

2) Second, replace (this may differ if you have a custom template)

<?php if ($categories) { ?>
<div id="menu">
  <ul>
    <?php foreach ($categories as $category) { ?>
    <li><a href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a>
      <?php if ($category['children']) { ?>
      <div>
        <?php for ($i = 0; $i < count($category['children']);) { ?>
        <ul>
          <?php $j = $i + ceil(count($category['children']) / $category['column']); ?>
          <?php for (; $i < $j; $i++) { ?>
          <?php if (isset($category['children'][$i])) { ?>
          <li><a href="<?php echo $category['children'][$i]['href']; ?>"><?php echo $category['children'][$i]['name']; ?></a></li>
          <?php } ?>
          <?php } ?>
        </ul>
        <?php } ?>
      </div>
      <?php } ?>
    </li>
    <?php } ?>
  </ul>
</div>
<?php } ?>

with

<?php if ($categories) { ?>
<div id="menu">
  <ul>
    <?php foreach ($categories as $category) { ?>
    <li><a href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a>
      <?php if ($category['children']) { ?>
      <div>
        <?php for ($i = 0; $i < count($category['children']);) { ?>
        <ul>
          <?php $j = $i + ceil(count($category['children']) / $category['column']); ?>
          <?php for (; $i < $j; $i++) { ?>
          <?php if (isset($category['children'][$i])) { ?>
          <li><a href="<?php echo $category['children'][$i]['href']; ?>"><?php echo $category['children'][$i]['name']; ?></a></li>
          <?php } ?>
          <?php } ?>
        </ul>
        <?php } ?>
      </div>
      <?php } ?>
    </li>
    <?php } ?>
    <li><a href="<?php echo $contact; ?>"><?php echo $text_contact; ?></a></li>
    <?php if ($informations) { ?>
    <li><a><?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>
      </div>
    </li>
    <?php } ?>
  </ul>
</div>
<?php } ?>

 in

catalog/view/theme/your theme or default/template/common/header.tpl

Done! Now you have the links in your menu.


HOW TO - Information & Contact Links in Opencart's Menu

Comments


Write A Comment

Your Name


Your Email Address


Your Comment Note: HTML is not translated!
By Alex Nicolae