Results 1 to 5 of 5
  1. #1
    Join Date
    Sep 2011
    Location
    UK
    Posts
    72
    Plugin Contributions
    0

    help question Currency flags instead of dropdown sidebox

    Hi,

    Im looking to add currency flags to my website instead of a dropdown sidebox. I have read a few of the suggestions already but not sure how to go about it as there are a couple of ways of doing it from what ive read. Please Help.

    Thanks

  2. #2
    Join Date
    Jan 2012
    Location
    London, UK
    Posts
    5
    Plugin Contributions
    0

    Idea or Suggestion Re: Currency flags instead of dropdown sidebox

    An easy way to do this would be mimic the functionality of the form for the currency sidebox (the drop-down menu).

    Below is the code for the form on version 1.3.9h as it exists on my local computer.

    Code:
    <form name="currencies_form" action="http://127.0.0.1/zc/index.php?main_page=index" method="get"><select name="currency" onchange="this.form.submit();">
      <option value="USD">US Dollar</option>
      <option value="EUR">Euro</option>
      <option value="GBP" selected="selected">GB Pound</option>
      <option value="CAD">Canadian Dollar</option>
      <option value="AUD">Australian Dollar</option>
    </select>
    <input type="hidden" name="main_page" value="index"></form>
    The form uses the GET method to send form data to the server. This is convenient because it shows us the information we need to create links that change the currency setting.

    At any rate, here are the links you'd end-up with.

    USD / American Flag
    http://127.0.0.1/zc/index.php?main_page=index&currency=USD

    GBP / British Flag
    http://127.0.0.1/zc/index.php?main_page=index&currency=GBP

    EUR / EURO sign or list 17 flags!
    http://127.0.0.1/zc/index.php?main_page=index&currency=EUR

    NB Be sure to insert your own IP/domain name and directory path in place of mine (my IP/domain is '127.0.0.1' and my directory path is 'zc'. Change those to suit your instance of Zen Cart.)

    For other currencies, just substitute a the 3 letter currency code for whatever currencies you want to offer. You must make sure the currency codes are defined in the Admin console before you can use them, Admin->Localization->Currencies

    The full HTML code, that is, a hyper-link'ed flag image that changes to currency setting, would look something like this:

    Code:
    <a href="http://127.0.0.1/zc/index.php?main_page=index&currency=EUR><img src="EuroFlag.png" width="30" height="20"></a>
    Now you just need to figure out where to put the currency flag links on your template and hard-code the links into the PHP. Personally, I'm not a big fan of hard-coding anything into ZC that cannot be changed via the admin console, but then, I'm also a fan of getting a reasonable amount of sleep!

    Hope this helps.

    Best wishes,

    Nao

  3. #3
    Join Date
    Feb 2010
    Posts
    2,159
    Plugin Contributions
    17

    Default Re: Currency flags instead of dropdown sidebox

    I used this mod: Language/Currency Links in Header

    then I added an ID to each currency link:

    Code:
    $content .= '<a id="navTopCurrencyId' . $currencies_array[$i]['id'] . '"' . 'href="'
    This way you can add/delete currencies from admin as you normally would

    All you have to do is add the currency flag as a background via css:

    Code:
    #navTopCurrencyIdUSD {
    padding:7px 2px 7px 30px;
    background-image: url(../images/USD.png);
    background-repeat:no-repeat;
    }
    You can see it in action here

  4. #4
    Join Date
    Jan 2012
    Location
    London, UK
    Posts
    5
    Plugin Contributions
    0

    Default Re: Currency flags instead of dropdown sidebox

    I would definitely take your approach rbarbour. Fewer calls to the server and fully controlled via admin panel = excellent stuff!

  5. #5
    Join Date
    Sep 2011
    Location
    UK
    Posts
    72
    Plugin Contributions
    0

    Default Re: Currency flags instead of dropdown sidebox

    Thanks for the replies guys.

    They both sound great. Dont want the flags in my header though. Would much rather have them in a sidebox but not as the dropdown menu. Just as link icons that change with one click of a mouse.

 

 

Similar Threads

  1. Language Drop-down Selector Instead of Flags?
    By cozyfolk in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 27 Aug 2011, 03:02 AM
  2. Currency flags instead of dropdown in sidebox?
    By plymgary1 in forum General Questions
    Replies: 1
    Last Post: 16 Mar 2011, 05:17 PM
  3. Manufacturer sidebox with drop dropdown instead of scrolling
    By rickiesdiscount in forum Addon Sideboxes
    Replies: 7
    Last Post: 14 Jul 2010, 04:51 PM
  4. Country flags instead of drop-down currency selector
    By needhelp123 in forum Currencies & Sales Taxes, VAT, GST, etc.
    Replies: 13
    Last Post: 1 Jun 2010, 11:28 AM
  5. Currency Flags in Header
    By kiermasz in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 4 Jul 2006, 08:22 PM

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