Community Forums

[How-to] Add information info links in footer

Free manual modifications can be contributed here. Modifications are manual snippets of code that are pasted into the forums for others to use.

[How-to] Add information info links in footer

Postby Maansy » Sat Aug 07, 2010 7:53 pm

if you like to add the information links to footer (live example), this is what you have to do:
Files we need to edit: 3

information_in_footer.jpg
information_in_footer.jpg (20.55 KiB) Viewed 16489 times


open: catalog\controller\common\footer
after:
Code: Select all

protected function index
() {
        $this->language->load('common/footer');
 

add:
Code: Select all
// information in footer
        $this->load->model('catalog/information');
        $this->load->model('tool/seo_url');
        $this->data['text_contact'] = $this->language->get('text_contact');
        $this->data['text_sitemap'] = $this->language->get('text_sitemap');
        $this->data['text_information'] = $this->language->get('text_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';    
        
//end
 



open: catalog\language\english\common\footer

befor ?>

add:
Code: Select all

$_
['text_contact']  = 'Contact Us';
$_['text_sitemap']  = 'Sitemap';
$_['text_information']  = 'Information';
 



open: catalog\view\theme\default\template\common\footer.tpl (the name of your template)

add this to the desired location to display (this is how i placed it, be creative):
Code: Select all

<div>
    <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>
ALL Templates :: 1.5.1+ Templates :: 50%-75% PRICE DROP ONLY at OpencartStuff.com
User avatar
Maansy
 
Posts: 928
Joined: Wed Jun 23, 2010 5:04 pm

Re: [How-to] Add information info links in footer

Postby Moggin » Sun Aug 08, 2010 3:00 pm

Thank you for this Maansy! And thanks also for the tutorial on showing the cart total in the header. Much appreciated.
Moggin
 
Posts: 1079
Joined: Tue May 04, 2010 3:56 pm

Re: [How-to] Add information info links in footer

Postby Maansy » Sun Aug 08, 2010 3:11 pm

You are welcome sir :)
ALL Templates :: 1.5.1+ Templates :: 50%-75% PRICE DROP ONLY at OpencartStuff.com
User avatar
Maansy
 
Posts: 928
Joined: Wed Jun 23, 2010 5:04 pm

Re: [How-to] Add information info links in footer

Postby mfrerebeau » Mon Aug 16, 2010 11:49 am

Hello,

Thanks a lot Maansy !
That was exactly I search...

I'm beginner in OpenCart... And I begin to understand somethings :)
I think we could make better with this line in catalog\controller\common\footer just before your change :
Code: Select all
      $this->language->load('module/information');

Then no need to modify catalog\language\english\common\footer and translate of the same words have to be made just one time.
It seems to work.

But as I'm beginner, perhaps it's a mistake ???
Could you validate it or say me why it isn't ?
Single we go faster, together we go more away...
User avatar
mfrerebeau
 
Posts: 21
Joined: Fri Aug 13, 2010 4:29 am
Location: France

Re: [How-to] Add information info links in footer

Postby Maansy » Mon Aug 16, 2010 5:41 pm

I think that's possible and I thought about it. This reason why I didn't do it that way simply because I didn't want to load another lang file due to speed of the page. And since footer.php in lang folder is loaded so why not utilize it.
ALL Templates :: 1.5.1+ Templates :: 50%-75% PRICE DROP ONLY at OpencartStuff.com
User avatar
Maansy
 
Posts: 928
Joined: Wed Jun 23, 2010 5:04 pm

Re: [How-to] Add information info links in footer

Postby mfrerebeau » Tue Aug 17, 2010 3:00 am

Thanks to take time explaining it.
That's interesting.
I'll think if I see some slowdowns...

It isn't very easy to see all of theses details when we begin... And it's very instructive. :)
Single we go faster, together we go more away...
User avatar
mfrerebeau
 
Posts: 21
Joined: Fri Aug 13, 2010 4:29 am
Location: France

Re: [How-to] Add information info links in footer

Postby carlchen414 » Wed Aug 18, 2010 2:04 pm

hello! Maansy. everyone! im new for opencart. I have got one problem with adding information into links in footer. I followed the steps shown above. but it shows me
Notice: Undefined variable: footer in C:\phpnow\htdocs\open_cart\catalog\view\theme\default\template\common\home.tpl on line 31...
what's problem with home.tpl??? i didnt change anything with home.tpl. could anyone help me. thanks in advanced!
carlchen414
 
Posts: 5
Joined: Wed Aug 18, 2010 1:59 pm

Re: [How-to] Add information info links in footer

Postby carlchen414 » Wed Aug 18, 2010 2:27 pm

thanks...sorry! i made a mistake...now mine is working..thanks Maansy, everyone!
carlchen414
 
Posts: 5
Joined: Wed Aug 18, 2010 1:59 pm

Re: [How-to] Add information info links in footer

Postby davykeenan » Sun Sep 05, 2010 8:24 am

Good tutorial, great work but if you want that little extra you can get this extension and it's all done for you.

http://www.opencart.com/index.php?route=extension/extension/info&extension_id=331&page=3

2CPTG,

Davy K
User avatar
davykeenan
 
Posts: 121
Joined: Tue Jun 16, 2009 7:01 am

Re: [How-to] Add information info links in footer

Postby Maansy » Sun Sep 05, 2010 11:00 am

whats your extra so i can included for free ;)
ALL Templates :: 1.5.1+ Templates :: 50%-75% PRICE DROP ONLY at OpencartStuff.com
User avatar
Maansy
 
Posts: 928
Joined: Wed Jun 23, 2010 5:04 pm

Re: [How-to] Add information info links in footer

Postby davykeenan » Sun Sep 05, 2010 12:41 pm

Well you know there is one way to find out, just purchase the mod, all code is free from license so you can post it up. I wish I could give away all my mods but got to make a living as time is money for me and of course a lot of opencart users wouldn't want to edit files themselves and don't understand php. O0
User avatar
davykeenan
 
Posts: 121
Joined: Tue Jun 16, 2009 7:01 am

Re: [How-to] Add information info links in footer

Postby davykeenan » Sun Sep 05, 2010 3:54 pm

Oh and they are all really cheap unlike a lot of other developers ;)
User avatar
davykeenan
 
Posts: 121
Joined: Tue Jun 16, 2009 7:01 am

Re: [How-to] Add information info links in footer

Postby fireatwire » Thu Sep 09, 2010 5:12 am

Very good mod. What do I have to do to put one single information page link in the footer?
fireatwire
 
Posts: 75
Joined: Tue Feb 02, 2010 4:21 pm

Re: [How-to] Add information info links in footer

Postby davykeenan » Thu Sep 09, 2010 6:20 am

fireatwire wrote:Very good mod. What do I have to do to put one single information page link in the footer?


Hi, if your taking about my footer mod, you can edit the language file

catalog\language\english\common\footer.php

you could do something like this (can remove or shorten opencart link to give more space, see admins they would like a donation to opencart to remove opencart link, but have said its ok to do so), then add info or link to the company bit.

$_['foot_created_by'] = ' ';
$_['foot_company'] = '<a href="myinfopage.php" title="whatever" >This is my new info link... blah...blah</a><br /><br />Thanks for viewing our website please contact us if you have an enquiry.';

COULD REMOVE THE THANKS STUFF TOO..

I know its a bit of a tech response but this mod was designed to be simple and not to heavy in code, and also work with custom themes.

If your still not sure or this isn't what you were looking for, let me know and I can help further, maybe change the mod to how you need it...

Davy K
Last edited by davykeenan on Thu Sep 09, 2010 6:27 am, edited 1 time in total.
User avatar
davykeenan
 
Posts: 121
Joined: Tue Jun 16, 2009 7:01 am

Re: [How-to] Add information info links in footer

Postby davykeenan » Thu Sep 09, 2010 6:26 am

fireatwire wrote:Very good mod. What do I have to do to put one single information page link in the footer?


just read the question another way as well.

If your looking for an information page to be displayed and there is not enough room, just move the sort order in the admin so the info page you want is at the top. sort order 1 or 2, then make sure the correct number of links is set in the language file.

If you want custom additions to this mod add them to the comments in the extensions page or email me dave@dknet.co.uk
User avatar
davykeenan
 
Posts: 121
Joined: Tue Jun 16, 2009 7:01 am

Re: [How-to] Add information info links in footer

Postby TAC » Sat Sep 25, 2010 3:00 pm

Hi, the code from Maansy is the first modification I made to OpenCart once I downloaded it today. It worked and put my information pages in the footer but nothing else. In the screen shot you have 3 lists with titles but I don't. Have I missed something? I would really like to have all the categories listed there too - is this possible?

Thanks in advance
Only upgrade if your life depends on it ;)
One of my OC shops http://www.theambercat.co.uk/store/
Another of my OC shops http://www.personalisedemporium.co.uk/
User avatar
TAC
 
Posts: 693
Joined: Sat Sep 25, 2010 12:33 pm
Location: England

Re: [How-to] Add information info links in footer

Postby davykeenan » Sun Sep 26, 2010 4:09 am

If you buy the mod/ext mentioned, the categories are included.

http://www.opencart.com/index.php?route ... 331&page=3

Davy K
User avatar
davykeenan
 
Posts: 121
Joined: Tue Jun 16, 2009 7:01 am

Re: [How-to] Add information info links in footer

Postby jty » Sun Oct 03, 2010 12:27 pm

Maansy wrote:whats your extra so i can included for free ;)

Don't temp me Maansy or you will be my slave for months :choke:
There is room for commercial mods. It's alot cheaper to pay money than to pay with all that time learning ........ except that I don't want a footer mod.

But I came to say thank-you Maansy. Your contribution, and free too, has solved a problem I have been too afraid to tackle for 2 months ie how to replace the layout.tpl
I've used your idea to mod the left column. Then I might use the idea to mod the right column. I suppose I should also use it to mod the header just because I can and you taught me how. Thank-you
jty
 
Posts: 1228
Joined: Fri Aug 29, 2008 7:19 pm

Re: [How-to] Add information info links in footer

Postby Maansy » Sun Oct 03, 2010 3:29 pm

jty wrote:
Maansy wrote:whats your extra so i can included for free ;)

Don't temp me Maansy or you will be my slave for months :choke:
There is room for commercial mods. It's alot cheaper to pay money than to pay with all that time learning ........ except that I don't want a footer mod.

But I came to say thank-you Maansy. Your contribution, and free too, has solved a problem I have been too afraid to tackle for 2 months ie how to replace the layout.tpl
I've used your idea to mod the left column. Then I might use the idea to mod the right column. I suppose I should also use it to mod the header just because I can and you taught me how. Thank-you



i hope you are just kidding here.

sure, you're welcome
ALL Templates :: 1.5.1+ Templates :: 50%-75% PRICE DROP ONLY at OpencartStuff.com
User avatar
Maansy
 
Posts: 928
Joined: Wed Jun 23, 2010 5:04 pm

Re: [How-to] Add information info links in footer

Postby Maansy » Sun Oct 03, 2010 4:08 pm

TAC wrote:Hi, the code from Maansy is the first modification I made to OpenCart once I downloaded it today. It worked and put my information pages in the footer but nothing else. In the screen shot you have 3 lists with titles but I don't. Have I missed something? I would really like to have all the categories listed there too - is this possible?

Thanks in advance

nope you didnt miss anything

this thread is [How-to] Add information info links in footer

for the others (account and bestsellers) i will post the How-to soon in different threads
ALL Templates :: 1.5.1+ Templates :: 50%-75% PRICE DROP ONLY at OpencartStuff.com
User avatar
Maansy
 
Posts: 928
Joined: Wed Jun 23, 2010 5:04 pm

Next

Return to Modifications

Who is online

Users browsing this forum: No registered users and 7 guests

Hosted by Arvixe Web Hosting