Post by kanum » Tue Sep 04, 2012 7:28 pm

Hi all,

I need your help, I have integrate opencart with my site, I need and several menus with multilanguage, but I allways get:

{quote}<a href=""><b>Notice</b>: Undefined variable: menushared in <b>/home/****/public_html/shop/catalog/view/theme/mytemplate/template/common/header.tpl</b> on line <b>84</b></a>{/quote}

I have create on header.php (on folder languages)

the strings:
$_['menushared'] = 'Hosting';

On my menu I have added:
<?php echo $text_menushared; ?>

But I get all the time the above "error" code. How can I add my own custome languages?

Thanks alot!

====================================
Problem Solved, reason for no work: Bad File Enconding, I have change from ANSI to UTF-8 - files: header.php (languages); header.php (controller); header.tpl (template).
Last edited by kanum on Sat Sep 08, 2012 8:50 am, edited 1 time in total.

New member

Posts

Joined
Tue Apr 10, 2012 11:41 pm

Post by anung » Tue Sep 04, 2012 8:35 pm

it should be
$_['text_menushared'] = 'Hosting';

User avatar
Active Member

Posts

Joined
Fri Mar 30, 2012 10:32 am
Location - Indonesia

Post by kanum » Fri Sep 07, 2012 1:04 am

Hi,

I have like this on header.tpl:

<li><a href="hosting.php"><?php echo $text_menushared; ?></a>

And at languages/header.php I have $_['text_menushared'] = 'Hosting';

But still not work, how can I correct this, please?

Thanks

New member

Posts

Joined
Tue Apr 10, 2012 11:41 pm

Post by kanum » Sat Sep 08, 2012 5:41 am

Opencart version 1.5.4.1
Many thanks!

I have follow this tutorial: http://forum.opencart.com/viewtopic.php?t=54501

Still not work... don't know what I can do more...

Please a little help :)

New member

Posts

Joined
Tue Apr 10, 2012 11:41 pm

Post by Christoforos » Fri Sep 13, 2013 2:38 pm

1. On catalog/language/<your language>/common/header.php
Add your language variable like that $_['text_menushared'] = 'Hosting';
2. on catalog/controller/common/header.php
Read your language data like that $this->data['text_menushared'] = $this->language->get('text_menushared');
3. On your menu show the variable <?php echo $text_menushared; ?> as you have it.

I had exactly the same issue with you.I had forgot step 2 and when I solve it, it worked.
You have forget the same step. It should work for you too.

Newbie

Posts

Joined
Fri Sep 13, 2013 1:20 pm
Who is online

Users browsing this forum: No registered users and 1 guest