Post by ipse » Wed Mar 03, 2010 4:09 am

1.4.0 shows Language and Currency selector in the header even if only one available, which is misleading to an user. This patch adds additional check for count()>1.

I think this would be a good fix to include into 1.4.1.

Inline diff:

Code: Select all

diff -r f6da21696cfd catalog/view/theme/default/template/common/header.tpl
--- a/catalog/view/theme/default/template/common/header.tpl	Tue Mar 02 22:41:50 2010 +0300
+++ b/catalog/view/theme/default/template/common/header.tpl	Tue Mar 02 22:50:12 2010 +0300
@@ -77,7 +77,7 @@
         <?php } ?>
       </div>
       <div class="div7">
-        <?php if ($currencies) { ?>
+        <?php if ($currencies && count($currencies)>1) { ?>
         <form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data" id="currency_form">
           <div class="switcher">
             <?php foreach ($currencies as $currency) { ?>
@@ -95,7 +95,7 @@
           <input type="hidden" name="redirect" value="<?php echo $redirect; ?>" />
         </form>
         <?php } ?>
-        <?php if ($languages) { ?>
+        <?php if ($languages && count($languages)>1) { ?>
         <form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data" id="language_form">
           <div class="switcher">
             <?php foreach ($languages as $language) { ?>
Archived diff:

Attachments

Last edited by i2Paq on Thu Oct 14, 2010 12:02 am, edited 1 time in total.
Reason: Topic moved

New member

Posts

Joined
Mon Mar 01, 2010 5:00 am

Post by starofriches » Tue Oct 12, 2010 3:57 am

Thanks for providing this! I was looking to comment this out because I didn't want the selectors to show up but this solution is much better. Very helpful!!

Newbie

Posts

Joined
Sat Aug 07, 2010 10:10 pm

Post by louisgaston » Thu Apr 14, 2011 6:27 am

This is exactly what I'm looking for. Where abouts do I paste this code ?

Cheers
Louis

Newbie

Posts

Joined
Thu Apr 14, 2011 6:24 am

Post by imagex » Wed May 18, 2011 10:20 am

i need to do this, where do you paste this code in? which file?

Thanks

New member

Posts

Joined
Fri Dec 04, 2009 3:10 am

Post by ipse » Wed May 18, 2011 3:46 pm

imagex wrote:i need to do this, where do you paste this code in? which file?

Thanks
This is a Unified Diff, read about it to understand what file should you modify:
http://en.wikipedia.org/wiki/Diff#Unified_format

New member

Posts

Joined
Mon Mar 01, 2010 5:00 am

Post by m_saraga » Sun May 29, 2011 12:38 am

I think this mod coul be great, if regular users, not programming gurus could add it. By directing us to Wikipedia, matters just get more complicated, and I guess we just altogether drop it. It might be simpler saying just "copy this here and paste it there" or something of the like. Just my 2 cents.

Thanks

New member

Posts

Joined
Tue May 17, 2011 1:31 am
Location - Miami, FL US

Post by qahar » Sun May 29, 2011 1:47 am

Open header.tpl and find:

Code: Select all

<?php if ($languages) { ?>

Code: Select all

<?php if ($currencies) { ?>
change to:

Code: Select all

<?php if ($languages && count($languages) > 1 ) { ?>

Code: Select all

<?php if ($currencies && count($currencies) > 1) { ?>

User avatar
Expert Member

Posts

Joined
Tue Jun 29, 2010 10:24 pm
Location - Indonesia

Post by m_saraga » Wed Jun 08, 2011 12:39 am

Fantastic!!! Thank you very much.

New member

Posts

Joined
Tue May 17, 2011 1:31 am
Location - Miami, FL US
Who is online

Users browsing this forum: No registered users and 2 guests