Results 1 to 7 of 7
  1. #1
    Join Date
    Jul 2007
    Posts
    64
    Plugin Contributions
    0

    Default Currencies Displayed in Alphabetical Order

    I have noticed that the currencies are displayed in alphabetical order in the admin. Yet they seem to be displayed in a random order (although the same random order each time) in the storefront. How could I make the currencies in the storefront display in alphabetical order in the sidebox "currencies" dropdown?

  2. #2
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: Currencies Displayed in Alphabetical Order

    The order that they are displayed isn't random, it's the order in which they appear in the database.

    Ideally you would change this at the point at which they are pulled out of the database, but I wouldn't recommend hacking away at the core code that does this, and so I suggest the following change instead.

    Create an over-ride file for your includes/modules/sideboxes/currencies.php file and then insert the two lines that I have added in the middle of this code sample.
    PHP Code:
          reset($currencies->currencies);
          
    $currencies_array = array();
          while (list(
    $key$value) = each($currencies->currencies)) {
            
    $currencies_array[] = array('id' => $key'text' => $value['title']);
          }

          function 
    text_cmp($a$b) {return strcmp($a["text"], $b["text"]);}
          
    usort($currencies_array'text_cmp');
                
          
    $hidden_get_variables '';
          
    reset($_GET);
          while (list(
    $key$value) = each($_GET)) {
            if ( (
    $key != 'currency') && ($key != zen_session_name()) && ($key != 'x') && ($key != 'y') ) {
              
    $hidden_get_variables .= zen_draw_hidden_field($key$value);
            }
          } 
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  3. #3
    Join Date
    Jul 2007
    Posts
    64
    Plugin Contributions
    0

    Default Re: Currencies Displayed in Alphabetical Order

    Worked a treat! Thank you kindly.

  4. #4
    Join Date
    May 2007
    Posts
    42
    Plugin Contributions
    0

    Default Re: Currencies Displayed in Alphabetical Order

    Hi.

    I have installed bunyip's most excellent currency header mod and it works fine. However, an ongoing issue I have is attempting to display a preferred sort order of the currencies.

    I only have GBP, EUR and USD and this is the order I wish to achieve.

    See: www.prestigeringcompany.com/index.php and you will note the order is USD, EUR, GBP

    I have deleted and reset the currencies to try and change the order and I have tried kuroi's fix and changed the currency title to try and influence any alphabetic sort, etc... but I am having no luck and slowly going mad...

    Would anybody know how I can achieve the preferred sort order of GBP EUR USD ...???

    Thank you kindly in advance...

    Steve
    121webconsultancy - Professional Website Design & Internet Marketing

  5. #5
    Join Date
    May 2009
    Posts
    413
    Plugin Contributions
    0

    Default Re: Currencies Displayed in Alphabetical Order

    Hi,

    Can anyone (hopefully kuroi!) confirm whether or not this is compatible with 1.3.9h? I tested it out and it seems to work fine, but I just wanted to double check!

    Thanks

  6. #6
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: Currencies Displayed in Alphabetical Order

    Yep. Nothing in there that's remotely version-related.
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  7. #7
    Join Date
    May 2009
    Posts
    413
    Plugin Contributions
    0

    Default Re: Currencies Displayed in Alphabetical Order

    Ok, thanks for the quick response kuroi

 

 

Similar Threads

  1. categories alphabetical order
    By saaliha in forum Templates, Stylesheets, Page Layout
    Replies: 6
    Last Post: 16 Jan 2011, 05:13 AM
  2. order of currencies displayed in Currency box
    By JacintaB in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 18 Aug 2010, 05:39 AM
  3. Sort Categories by Alphabetical Order
    By brooklyn in forum Setting Up Categories, Products, Attributes
    Replies: 0
    Last Post: 23 Jun 2006, 05:59 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR