Post by dmsadmin » Sat Dec 15, 2012 3:31 am

Good day,

Running OC : 1.5.4.1

I am trying to modify my language.tpl file not to show the country flags, just the language names? I searched couldn't find an example and I tired with no success to get this top happen.

So all I want to appear is Language English French

Here is my language.tpl file, can someone help?

Code: Select all

<?php if (count($languages) > 1) { ?>
<form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data">
  <div id="language" align="right"><?php echo $text_language; ?>
    <?php foreach ($languages as $language) { ?>
    <img src="image/flags/<?php echo $language['image']; ?>" alt="<?php echo $language['name']; ?>" title="<?php echo $language['name']; ?>" onClick="$('input[name=\'language_code\']').attr('value', '<?php echo $language['code']; ?>').submit(); $(this).parent().parent().submit();" />
    <?php } ?>
    <input type="hidden" name="language_code" value="" />
    <input type="hidden" name="redirect" value="<?php echo $redirect; ?>" />
  </div>
</form>
</br>
<?php } ?>

Newbie

Posts

Joined
Tue Nov 20, 2012 11:39 pm

Post by MrTech » Sat Dec 15, 2012 5:33 am

Salut, remplace le code suivant (take this code out):

Code: Select all

<img src="image/flags/<?php echo $language['image']; ?>
Replace with this:

Code: Select all

<?php echo $language['name']; ?>
I haven't tested it, but should work, let me know if not and I'll test it further.

~
Install Extensions OR OpenCart Fast Service! PayPal Accepted
I will professionally install and configure any free or purchased theme, module or extension.

Visit http://www.mrtech.ca if you need an OpenCart webmaster
~


User avatar
Active Member

Posts

Joined
Mon Jan 09, 2012 2:39 pm
Location - Canada, Eh!

Post by pakho » Wed Jan 22, 2014 2:45 pm

to change the language flags into text, you have to modify 2 things.

in language.tpl located in catalog/view/theme/default/template/module:

Code: Select all

<?php if (count($languages) > 1) { ?>
<form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data">
  <div id="language">
    <?php foreach ($languages as $language) { ?>
        <a class="lang" onclick="$('input[name=\'language_code\']').attr('value', '<?php echo $language['code']; ?>'); $(this).parent().parent().submit();"> <?php echo $language['name']; ?> </a>
    <?php } ?>
    <input type="hidden" name="language_code" value="" />
    <input type="hidden" name="redirect" value="<?php echo $redirect; ?>" />
  </div>
</form>
<?php } ?>

and you have to change the stylesheet.css located in catalog/view/theme/default/stylesheet :

you have to add

Code: Select all

a.lang{ 
	padding:0px 8px 0px 8px;
}
you have to locate this and change the width to auto like i did here

Code: Select all

#language {
	position: absolute;
	top: 15px;
	left: 320px;
	width: auto;
	color: #999;
	line-height: 17px;
	padding:10px;
}

Newbie

Posts

Joined
Wed Jan 08, 2014 11:04 am
Who is online

Users browsing this forum: No registered users and 49 guests