Results 1 to 6 of 6
  1. #1
    Join Date
    May 2010
    Location
    Athens, Greece
    Posts
    292
    Plugin Contributions
    0

    Default Currency and Language display

    I am puzzled with the way Zen Cart displays currencies. I have two languages installed, English and Greek and want prices to be displayed in GBP when in English and in EUR when in Greek pages.

    I have set the default currency for each language as follows:

    includes/languages/my_template/english.php

    Code:
    define('LANGUAGE_CURRENCY', 'GBP');
    includes/languages/my_template/greek.php

    Code:
    define('LANGUAGE_CURRENCY', 'EUR');
    I also have these settings in Admin:

    Admin > Localization > Languages > English (default)
    Admin > Localization > Currencies > Euro (default)
    Admin > Configuration > My Store > Language Selector = Browser
    Admin > Configuration > My Store > Switch To Default Language Currency = true

    The idea behind the settings is:

    1) If a visitor's browser is in Greek, the Greek home page will load and prices will be displayed in EUR.

    2) If a visitor's browser is in English or any other language, the English home page will load with prices displayed in GBP.

    What happens though is that calling www.athenscollectibles.info loads the English home page but with prices in EUR. Prices change to GBP only if English language is selected from the header. In this case, if the page is refreshed after a period of inactivity, the page remains in English but currency changes to EUR by itself.

    I assume that this has to do with cookies expiring after a few minutes and, refreshing the page, causes the default currency to display rather than the currency defined in the language file. Although I don't know the inside workings of Zen Cart, I believe that the solution is to automatically reselect the language with each page refresh.

    If this is the case, is there a way to force language selection with each page refresh? If this is only a false assumption, can anyone explain what's going on and how I can achieve the desired display of currencies?

    P.S. I am on ZC 1.5 but the same happened before upgrading from 1.3.9h. I also have the Language/Currency Links in Header add on.

    Thanks in advance for any help.

  2. #2
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,948
    Plugin Contributions
    96

    Default Re: Currency and Language display

    Quote Originally Posted by Athens Collectibles View Post
    ...
    I also have these settings in Admin:

    Admin > Localization > Languages > English (default)
    Admin > Localization > Currencies > Euro (default)
    Admin > Configuration > My Store > Language Selector = Browser
    Admin > Configuration > My Store > Switch To Default Language Currency = true
    So, the default language is English and the default currency is Euro? Shouldn't the defaults match (i.e. English/Pound or Greek/Euro)?

  3. #3
    Join Date
    May 2010
    Location
    Athens, Greece
    Posts
    292
    Plugin Contributions
    0

    Default Re: Currency and Language display

    Shouldn't the defaults match (i.e. English/Pound or Greek/Euro)?
    This is done with the definitions in the language files and it works correctly once the language is selected with the relative flag. The problem is that the currency returns to Euro when the page is refreshed after some time, probably when cookies expire.

  4. #4
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,267
    Plugin Contributions
    3

    Default Re: Currency and Language display

    What if a Greek-speaking person, living in the UK, wants to see the site in GREEK, but the currency in GBP?

    And what if an English-speaking person, living in Greece, wants to see the site in ENGLISH, but the currency in EURO?

    Just let the viewer make their own choices... I know most customers are stupid, but I think they will know how to set a different language or currency.
    20 years a Zencart User

  5. #5
    Join Date
    May 2010
    Location
    Athens, Greece
    Posts
    292
    Plugin Contributions
    0

    Default Re: Currency and Language display

    The first person would click on the Greek flag to change language and would select British Pound from the currency drop-down.

    The second would click on the Union Jack to change language and would select Euro from the currency drop-down.

    However, if all worked as intended, they would both have to change the currency only, assuming that their browsers were set in their native language.

    Additionally, Britons living in the UK would not be required to do anything as they would see the site in English and Pound as the default currency. The same applies to Greeks living in Greece.

    I understand that not everything can be automated but I'm trying to make things easier for as many people as possible, on the understanding that most customers are not very bright (that's a more elegant definition of stupid but has the same meaning).

    Regardless of desired and available functionality, is my suspicion about expired cookies correct? If no, there must be something else causing the auto-change of currency.

  6. #6
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,948
    Plugin Contributions
    96

    Default Re: Currency and Language display

    Quote Originally Posted by Athens Collectibles View Post
    This is done with the definitions in the language files and it works correctly once the language is selected with the relative flag. The problem is that the currency returns to Euro when the page is refreshed after some time, probably when cookies expire.
    Right, but my unstated point is that your admin settings have the default of English and Euro; that might the the root cause of the refresh problem you described.

    P.S. I do agree with schooboy's "let the customer choose" ...

 

 

Similar Threads

  1. Remove language and currency boxes
    By dddmx3 in forum Templates, Stylesheets, Page Layout
    Replies: 15
    Last Post: 18 Aug 2010, 02:42 PM
  2. no need in language and currency in header
    By Ms_X in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 2 Apr 2010, 01:14 PM
  3. currency and language at top of page
    By merlinof2 in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 23 Nov 2009, 06:51 PM
  4. Language and Currency in header
    By DocRocks in forum All Other Contributions/Addons
    Replies: 9
    Last Post: 8 Nov 2009, 10:53 AM
  5. Language and Currency removal
    By Steveh in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 1 Mar 2007, 10:25 AM

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