Page 1 of 1

information box moved to footer

Posted: Fri Jun 08, 2012 2:58 pm
by mbeerden
Does anyone know how i can move the information box to the footer of the shop? I'm using OC 1.4

my footer code looks like this:

Code: Select all

</div>
<div id="footer">
  <div class="div1"><a onclick="window.open('http://www.ideal.nl');"><img src="catalog/view/theme/default/image/payment_ideal.png" alt="" /></a></div>
  <div class="div2" id="information">
      <ul>
      <?php foreach ($informations as $information) { ?>
      <li><a href="<?php echo $information['href']; ?>"><?php echo $information['title']; ?></a></li>
      <?php } ?>
      <li><a href="<?php echo $contact; ?>"><?php echo $text_contact; ?></a></li>
      <li><a href="<?php echo $sitemap; ?>"><?php echo $text_sitemap; ?></a></li>
    </ul>
  </div>  
  <div class="div3">Powered by:<a onclick="window.open('http://www.opencart.com');"><u>OpenCart</u></a>&nbsp;</div>
</div>
<?php echo $google_analytics; ?>
</body></html>
i'm getting the following error:
Notice: Undefined variable: informations in /var/www/vhosts/***.nl/httpdocs/demo/catalog/view/theme/default/template/common/footer.tpl on line 6Warning: Invalid argument supplied for foreach() in /var/www/vhosts//***..nl/httpdocs/demo/catalog/view/theme/default/template/common/footer.tpl on line 6
Notice: Undefined variable: text_contact in /var/www/vhosts//***..nl/httpdocs/demo/catalog/view/theme/default/template/common/footer.tpl on line 9
Notice: Undefined variable: text_sitemap in /var/www/vhosts//***..nl/httpdocs/demo/catalog/view/theme/default/template/common/footer.tpl on line 10
I know i've got to adjust another file.. but wich one? Can anyone help me?

Re: information box moved to footer

Posted: Fri Jun 08, 2012 5:23 pm
by mbeerden
i've made some progression. I've got the contact and sitemap moved from the information box. Now the variable info pages.

I'm gettin an error:
atal error: Call to a member function getInformations() on a non-object in /var/www/vhosts/rjpshop.nl/httpdocs/demo/catalog/controller/common/footer.php on line 29
My footer code:

Code: Select all

<?php  
class ControllerCommonFooter extends Controller {
	protected function index() {
		$this->language->load('common/footer');
		
		$this->data['text_powered_by'] = sprintf($this->language->get('text_powered_by'), $this->config->get('config_store'), date('Y', time()));
			
		$this->id = 'footer';

		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';
		}
		
		if ($this->config->get('google_analytics_status')) {
			$this->data['google_analytics'] = $this->config->get('google_analytics_code');
		} else {
			$this->data['google_analytics'] = '';
		}

		$this->data['informations'] = array();

		$this->data['text_contact'] = $this->language->get('text_contact');
    	$this->data['text_sitemap'] = $this->language->get('text_sitemap');		

		$this->data['informations'] = array();

		foreach ($this->model_catalog_information->getInformations() as $result) {
      		$this->data['informations'][] = array(
        		'title' => $result['title'],
	    		'href'  => $this->model_tool_seo_url->rewrite($this->url->http('information/information&information_id=' . $result['information_id']))
      		);
    	}		
		$this->render();
	}
}
?>
can anyone help me?

Re: information box moved to footer

Posted: Fri Jun 08, 2012 6:47 pm
by MarketInSG
shouldn't your footer box have the information column?

Re: information box moved to footer

Posted: Fri Jun 08, 2012 8:03 pm
by mbeerden
nope.. this is de 1.4 version without the information column in the footer. this one had the information in the left column.

I'm trying to give this site the 1.5* look, because of the large amount of modifications i cant upgrade...

that's why i'm trying to move the info box to the footer.

Re: information box moved to footer

Posted: Sun Jun 10, 2012 5:05 pm
by mbeerden
anyone with some help in this one? thanks!

Re: information box moved to footer

Posted: Tue Jun 12, 2012 11:10 pm
by mcamca
mbeerden wrote:anyone with some help in this one? thanks!
If you supply the exact version number of the Opencart version that you are using then may be able to help eg. is it v1.4.0, v1.4.1, v1.4.2 upto v1.4.9 or one inbetween!
You'll find the exact version you're using in Admin at the bottom of the page!
Also what do you want in the footer, all of the lists in v1.5.2.1 etc or just "Information"?
Lists in v1.5.2.1 are: Information - Customer Service - Extras - My Account
Some of the items in these lists do not exist in the 1.4 versions so it may be better if you state all of the individual items that you want in the lists!

Re: information box moved to footer

Posted: Fri Jun 15, 2012 3:21 pm
by mbeerden
Hi MCAMCA,

i'm using OC 1.4.0 on this one. what will be the pages i want in the footer:

- The information pages added throught the admin
- contact
- sitemap

that's all.

Re: information box moved to footer

Posted: Fri Jun 15, 2012 3:46 pm
by mbeerden
i've figured out the problem!

changed:
catalog/controller/common/footer.php
catalog/view/theme/default/common/footer.tpl
languages/**/common/footer.php

Result:
catalog/controller/common/footer.php

Code: Select all

<?php  
class ControllerCommonFooter extends Controller {
	protected function index() {
		$this->language->load('common/footer');
		
		$this->data['text_powered_by'] = sprintf($this->language->get('text_powered_by'), $this->config->get('config_store'), date('Y', time()));

		$this->data['text_contact'] = $this->language->get('text_contact');
    	$this->data['text_sitemap'] = $this->language->get('text_sitemap');
		
		$this->load->model('catalog/information');		
		
		$this->data['contact'] = $this->url->http('information/contact');
    	$this->data['sitemap'] = $this->url->http('information/sitemap');		

		$this->data['informations'] = array();

		foreach ($this->model_catalog_information->getInformations() as $result) {
      		$this->data['informations'][] = array(
        		'title' => $result['title'],
	    		'href'  => $this->model_tool_seo_url->rewrite($this->url->http('information/information&information_id=' . $result['information_id']))
      		);
    	}
		
		$this->id = 'footer';

		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';
		}
		
		if ($this->config->get('google_analytics_status')) {
			$this->data['google_analytics'] = $this->config->get('google_analytics_code');
		} else {
			$this->data['google_analytics'] = '';
		}
		
		$this->render();
	}
}
?>
catalog/view/theme/default/common/footer.tpl

Code: Select all

</div>
<div id="footer">
 <div id="footer-container">
  <div class="div1"></div>
  <div class="div2" id="information">
      <ul>
      <?php foreach ($informations as $information) { ?>
      <li><a href="<?php echo $information['href']; ?>"><?php echo $information['title']; ?></a></li>
      <?php } ?>
      <li><a href="<?php echo $contact; ?>"><?php echo $text_contact; ?></a></li>
      <li><a href="<?php echo $sitemap; ?>"><?php echo $text_sitemap; ?></a></li>
    </ul>
  </div>  
  <div class="div3"></div>
 </div>
</div>
<?php echo $google_analytics; ?>
</body></html>
languages/**/common/footer.php

Code: Select all

<?php
// Text
$_['text_contact'] = 'Contact';
$_['text_sitemap'] = 'Sitemap';
$_['text_powered_by'] = 'Powered By <a href="http://www.opencart.nl">OpenCart</a><br /> %s &copy; %s';
?>