Web Development & WordPress

Opencart issue: Changing logo while changing language flag instantly

Use the following code if u want to show different logo image in different language pages in Opencart sites.

This code Also solves / helps

1. Changing language and changing logo instantly…there is no lapses or need to refresh the page again

*** i used this code in Journal2 theme and i had to modify the following file

/public_html/catalog/view/theme/journal2/template/journal2/headers/center.nosecond.tpl

but depending on your opencart theme you may need to modify the header.tpl file

<?php if ( $lang=='ar') { ?>
  <div id="logo"><a href="<?php echo $home; ?>"><img src="/image/LOGODONEARABIC.png" title="<?php echo $name; ?>" alt="<?php echo $name; ?>" /></a>  </div>
  <?php } ?>
  <?php if ( $lang=='en' ) { ?>
  <div id="logo"><a href="<?php echo $home; ?>"><img src="<?php echo $logo; ?>" title="<?php echo $name; ?>" alt="<?php echo $name; ?>" /></a></div>
  <?php } ?>


If you have any issue feel free to ask me question here in comments section

Leave a comment