Post by mjutras » Sat Jan 19, 2013 11:08 pm

I was able to add new menu items to the top menu however I am stuck with 'Contact Us'
In the header.tpl file I was able to add:

Code: Select all

<li><a href="<?php echo $home; ?>"><?php echo $text_home; ?></a></li>
with no problem, had to use this because I have multiple languages.

But if I try to use:

Code: Select all

<li><a href="<?php echo $contact; ?>"><?php echo $text_contact; ?></a></li>
It is blank. I copied this from the footer which is working well from there.

What's missing?
Last edited by mjutras on Sun Jan 20, 2013 6:05 am, edited 1 time in total.

New member

Posts

Joined
Sun Jan 13, 2013 12:28 am

Post by labeshops » Sat Jan 19, 2013 11:42 pm

The $contact and $text_contact aren't defined in the controller file for the header. You'd need to add them or easier just make it a static instead of dynamic link:

Code: Select all

<li><a href="/whatever-the-link-to-your-page-is">Contact Us</a></li>

Running Opencart v3.0.3.2 with multi-stores from https://www.labeshops.com which has links to all my stores.

Image


User avatar
Expert Member

Posts

Joined
Thu Aug 04, 2011 4:41 am
Location - Florida, USA

Post by mjutras » Sun Jan 20, 2013 2:23 am

The reason why I need it dynamic is because I have more than one language.
How would I go about adding the info in the controller file?

New member

Posts

Joined
Sun Jan 13, 2013 12:28 am

Post by ChetanCx » Sun Jan 20, 2013 3:23 am

1. open catalog/language/your_language/common/header.php, add

Code: Select all

$_['text_contact']           = 'Contact Us;
similary for all languages you have.

2. in catalog/controller/common/header.php add

Code: Select all

$this->data['text_contact'] = $this->language->get('text_contact');
$this->data['contact'] = $this->url->link('information/contact');
3. now freely use in your header.tpl

Code: Select all

<li><a href="<?php echo $contact; ?>"><?php echo $text_contact; ?></a></li>

User avatar
Active Member

Posts

Joined
Sat Dec 08, 2012 8:12 pm

Post by mjutras » Sun Jan 20, 2013 6:05 am

Working like a charm Thank you!

Mike

New member

Posts

Joined
Sun Jan 13, 2013 12:28 am
Who is online

Users browsing this forum: No registered users and 37 guests