Post by Maansy » Tue Apr 17, 2012 5:54 am

hi coders
i am trying to achieve a dropdown menu for languages and this is what i came across (not working but this was my try)

in catalog\view\theme\**my_theme**\template\module\language.tpl
i edit the whole file to be:

Code: Select all

<?php if (count($languages) > 1) { ?>
<form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data">
  <div id="language">
		<div class="heading">
			<?php foreach ($languages as $language) { ?>
			<span><img src="image/flags/<?php echo $language['image']; ?>" alt="<?php echo $language['name']; ?>" title="<?php echo $language['name']; ?>" />&nbsp;<?php echo $language['name']; ?></span>
			<?php } ?>
		</div>
	  <ul>
		<?php foreach ($languages as $language) { ?>	
		<li onClick="$('input[name=\'language_code\']').attr('value', '<?php echo $language['code']; ?>').submit(); $(this).parent().submit();">
			<img src="image/flags/<?php echo $language['image']; ?>" alt="<?php echo $language['name']; ?>" title="<?php echo $language['name']; ?>"  />&nbsp;<?php echo $language['name']; ?>
			  
		</li>
		<?php } ?>	
	  </ul>
  </div>
    <input type="hidden" name="language_code" value="" />
    <input type="hidden" name="redirect" value="<?php echo $redirect; ?>" />
  
</form>
<?php } ?>
in the stylesheet i made added this:

Code: Select all

#language {
	position: absolute;
	top: 13px;
	left: 185px;
	width: 115px;
	color: #777777;
	line-height: 17px;
	border-right: 1px dotted #444444;
	z-index: 50;
}
#language img {
	cursor: pointer;
}
#language ul {
    background-color: #F7F7F7;
    display: none;
    left: 0;
    padding: 4px 0;
    position: absolute;
    top: 55px;
    width: 135px;
    z-index: 1110;
}
#language ul li {
    color: #444444;
    cursor: pointer;
    padding: 3px 10px;
}
i would appreciate some coding assistance as i am a designer but not a coder ;)
hope this topic would be helpful for some including me
thanks in advance

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


User avatar
Active Member

Posts

Joined
Thu Jun 24, 2010 6:04 am


Post by Avvici » Tue Apr 17, 2012 6:02 am

Version of Open Cart?

User avatar
Expert Member

Posts

Joined
Tue Apr 05, 2011 12:09 pm
Location - Asheville, NC

Post by Maansy » Tue Apr 17, 2012 6:17 am

after several search and try, i got it working :)
Last edited by Maansy on Fri May 04, 2012 5:12 am, edited 1 time in total.

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


User avatar
Active Member

Posts

Joined
Thu Jun 24, 2010 6:04 am


Post by Maansy » Wed Apr 18, 2012 1:40 am

any taker?

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


User avatar
Active Member

Posts

Joined
Thu Jun 24, 2010 6:04 am


Post by suramya » Fri May 11, 2012 8:14 pm

can u please provide the correct code?

Newbie

Posts

Joined
Thu May 03, 2012 6:52 pm

Post by iamafaker » Tue Dec 24, 2013 5:46 pm

push

Active Member

Posts

Joined
Wed Sep 18, 2013 3:19 pm
Who is online

Users browsing this forum: Bing [Bot] and 19 guests