Post by vimal » Mon Jul 19, 2010 3:31 am

Hi All,

I have been using the below piece of code in the footer.php file in the controller folder to show the information links in the footer. It works fine in OC1.4.8 too but when I enable the maintenance mode, it gives an error

Fatal error: Call to a member function rewrite() on a non-object in C:\Server\xampp\htdocs\oc148\catalog\controller\common\footer.php on line 25

Can someone please help me on what is wrong with the line 25 which is

'href' => $this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=information/information&information_id=' . $result['information_id'])
);


Code: Select all

		//Information links
      $this->language->load('module/information');
      $this->data['breadcrumbs'] = $this->document->breadcrumbs;
      $this->data['text_special'] = $this->language->get('text_special');
      $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['informations'] = array();
      
      foreach ($this->model_catalog_information->getInformations() as $result) {
            $this->data['informations'][] = array(
              'title' => $result['title'],
			  'href'  => $this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=information/information&information_id=' . $result['information_id'])
            );
       }
      
      
      $this->data['contact'] = HTTP_SERVER . 'index.php?route=information/contact';
       $this->data['sitemap'] = HTTP_SERVER . 'index.php?route=information/sitemap';
	   $this->data['special'] = HTTP_SERVER . 'index.php?route=product/special';
      
      //end information links

www.beeshop.se
Starta webbshop, Starta e-butik, Starta e-handel


Active Member

Posts

Joined
Wed Aug 26, 2009 8:54 am
Location - Sweden

Post by vimal » Mon Jul 19, 2010 3:44 am

Fixed it myself. The code to use is below.

Code: Select all

//info links
				$this->language->load('module/information');
		
    	$this->data['heading_title'] = $this->language->get('heading_title');
    	
		$this->data['text_contact'] = $this->language->get('text_contact');
    	$this->data['text_sitemap'] = $this->language->get('text_sitemap');
		
		$this->load->model('catalog/information');
		$this->load->model('tool/seo_url');
		
		$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(HTTP_SERVER . 'index.php?route=information/information&information_id=' . $result['information_id'])
      		);
    	}

		$this->data['contact'] = HTTP_SERVER . 'index.php?route=information/contact';
    	$this->data['sitemap'] = HTTP_SERVER . 'index.php?route=information/sitemap';
		//eof info links

www.beeshop.se
Starta webbshop, Starta e-butik, Starta e-handel


Active Member

Posts

Joined
Wed Aug 26, 2009 8:54 am
Location - Sweden

Post by Shelly » Thu Jul 29, 2010 10:09 pm

I've copied your code to my footer.php file. Not being a programmer, what do I put in the footer. tpl file? I've tried <div class="div3"><?php echo $text_sitemap; ?></div> as a starter, but nothing. Can you help?
Thanks

Newbie

Posts

Joined
Thu May 20, 2010 2:11 am

Post by vimal » Fri Aug 06, 2010 6:12 am

Hi! Sorry for not writin earlier.

My footer.tpl file looks like below.

Code: Select all

<div id="footer">
				<div id="footer_middle">
				  <center>

						  <?php foreach ($informations as $information) { ?>

						  <a href="<?php echo $information['href']; ?>"><?php echo $information['title']; ?></a>&nbsp; &nbsp;|&nbsp; &nbsp;

						  <?php } ?>

						  <a href="<?php echo $contact; ?>"><?php echo $text_contact; ?></a>&nbsp; &nbsp;|&nbsp; &nbsp;

						  <a href="<?php echo $sitemap; ?>"><?php echo $text_sitemap; ?></a><br/><br/>
						  <?php echo $store; ?> &copy; <?PHP echo date( "Y" ); ?>

				  </center>
				</div><!--footermiddle-->
				

				</div><!--footer-->
				
				
<?php echo $google_analytics; ?>

<script type="text/javascript" src="catalog/view/theme/default2/javascript/livesearch.js"></script>
<script type="text/javascript" src="catalog/view/theme/default2/javascript/jquery.nivo.slider.pack.js" type="text/javascript"></script>
</body></html>
In teh stylesheet add the below.

Code: Select all

#footer, #footer a {
	width: 100%;
	clear: both;
	padding-top: 10px;
	padding-bottom: 10px;
	border-top: 1px solid #DDDDDD;
	color: #1B57A3;
}
#footer a:hover{
	font-weight:normal;
}
#footer .center {
	margin-left: auto;
	margin-right: auto;
	text-align: center;
}

www.beeshop.se
Starta webbshop, Starta e-butik, Starta e-handel


Active Member

Posts

Joined
Wed Aug 26, 2009 8:54 am
Location - Sweden
Who is online

Users browsing this forum: No registered users and 4 guests