Post by gunner86 » Fri Jun 23, 2017 5:26 am

Hi ,
i want to make css changing on Currency and Language Boxes , but i couldnt . ( i did something but not the same as the picture , please look at to the picture in attac. ) .

the modules are free , here is the link

https://www.opencart.com/index.php?rout ... load_id=36

and the module has only a .tpl file , here is the codes ...

<link rel="stylesheet" type="text/css" href="catalog/view/theme/nina_shop/stylesheet/flags.css" />
<?php if (count($currencies) > 1) { ?>
<form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data">
<div id="currency" style="width: auto;background: #F8F8F8;border: 1px solid #CCCCCC;">
<img id="cur" data-image="catalog/view/theme/nina_shop/stylesheet/images/blank.gif" class="flag"/>
<select id="currencies" name="currencies" onChange="$('input[name=\'currency_code\']').attr('value', $('#currencies option:selected').val()
).submit(); $(this).parent().parent().submit();" style="padding: 0px; border: none;background: none;">
<?php foreach ($currencies as $currency) { ?>
<?php if ($currency['code'] == $currency_code) { ?>
<option selected value="<?php echo $currency['code']; ?>"><?php echo $currency['title']; ?></option>
<?php }else{ ?>
<option value="<?php echo $currency['code']; ?>"><?php echo $currency['title']; ?></option>
<?php } ?>
<?php } ?>
</select>
<input type="hidden" name="currency_code" value="" />
<input type="hidden" name="redirect" value="<?php echo $redirect; ?>" />
</div>
</form>
<?php } ?>
<script>
(function($) {
// USAGE:
$(function() {
// on load:
var cur=$('select[name="currencies"]').val().toLowerCase();
$('#cur').addClass(cur.slice(0,-1));
});
})(jQuery);
</script>

Attachments

SBoxCSS.jpg

SBoxCSS.jpg (24.22 KiB) Viewed 684 times


Active Member

Posts

Joined
Wed Jul 09, 2014 3:43 pm
Who is online

Users browsing this forum: Amazon [Bot] and 116 guests