Post by Maansy » Sun Aug 08, 2010 8:53 am

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 23284 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
Newbie

Posts

Joined
Thu Jun 24, 2010 6:04 am


Post by Moggin » Mon Aug 09, 2010 4:00 am

Thank you for this Maansy! And thanks also for the tutorial on showing the cart total in the header. Much appreciated.

Newbie

Posts

Joined
Wed May 05, 2010 4:56 am

Post by Maansy » Mon Aug 09, 2010 4:11 am

You are welcome sir :)

ALL Templates :: 1.5.1+ Templates :: 50%-75% PRICE DROP ONLY at OpencartStuff.com


User avatar
Newbie

Posts

Joined
Thu Jun 24, 2010 6:04 am


Post by mfrerebeau » Tue Aug 17, 2010 12: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
Newbie

Posts

Joined
Fri Aug 13, 2010 5:29 pm
Location - France

Post by Maansy » Tue Aug 17, 2010 6:41 am

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
Newbie

Posts

Joined
Thu Jun 24, 2010 6:04 am


Post by mfrerebeau » Tue Aug 17, 2010 4:00 pm

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
Newbie

Posts

Joined
Fri Aug 13, 2010 5:29 pm
Location - France

Post by carlchen414 » Thu Aug 19, 2010 3:04 am

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!

Newbie

Posts

Joined
Thu Aug 19, 2010 2:59 am

Post by carlchen414 » Thu Aug 19, 2010 3:27 am

thanks...sorry! i made a mistake...now mine is working..thanks Maansy, everyone!

Newbie

Posts

Joined
Thu Aug 19, 2010 2:59 am

Post by davykeenan » Sun Sep 05, 2010 9:24 pm

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 ... 331&page=3

2CPTG,

Davy K

User avatar
Newbie

Posts

Joined
Tue Jun 16, 2009 8:01 pm

Post by Maansy » Mon Sep 06, 2010 12: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
Newbie

Posts

Joined
Thu Jun 24, 2010 6:04 am


Post by davykeenan » Mon Sep 06, 2010 1:41 am

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
Newbie

Posts

Joined
Tue Jun 16, 2009 8:01 pm

Post by davykeenan » Mon Sep 06, 2010 4:54 am

Oh and they are all really cheap unlike a lot of other developers ;)

User avatar
Newbie

Posts

Joined
Tue Jun 16, 2009 8:01 pm

Post by fireatwire » Thu Sep 09, 2010 6:12 pm

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

Newbie

Posts

Joined
Wed Feb 03, 2010 5:21 am

Post by davykeenan » Thu Sep 09, 2010 7:20 pm

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 7:27 pm, edited 1 time in total.

User avatar
Newbie

Posts

Joined
Tue Jun 16, 2009 8:01 pm

Post by davykeenan » Thu Sep 09, 2010 7:26 pm

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
Newbie

Posts

Joined
Tue Jun 16, 2009 8:01 pm

Post by TAC » Sun Sep 26, 2010 4:00 am

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

User avatar
TAC
Newbie

Posts

Joined
Sun Sep 26, 2010 1:33 am
Location - England

Post by davykeenan » Sun Sep 26, 2010 5:09 pm

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
Newbie

Posts

Joined
Tue Jun 16, 2009 8:01 pm

Post by jty » Mon Oct 04, 2010 1:27 am

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
Newbie

Posts

Joined
Sat Aug 30, 2008 8:19 am

Post by Maansy » Mon Oct 04, 2010 4:29 am

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
Newbie

Posts

Joined
Thu Jun 24, 2010 6:04 am


Post by Maansy » Mon Oct 04, 2010 5:08 am

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
Newbie

Posts

Joined
Thu Jun 24, 2010 6:04 am

Who is online

Users browsing this forum: No registered users and 5 guests