Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2006
    Posts
    31
    Plugin Contributions
    0

    Default Currency redirection behaviour

    Hi All,

    I have set up a couple of links on my site to allow customers to select a preferred currency. This is working however when the currency is changed Zen Cart redirects the customer back to the home page.

    I would prefer if the customer can change their currency and be redirected back to the page they were previously on.

    Often the customer will only want to see the price in their native currency when they have found an item they like, but after changing the currency they are forced to renavigate their way from the initial home page all the way back to the item.

    Any help appreciated.

  2. #2
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Currency redirection behaviour

    If you look how this is done in the currency sidebox it will probably help you out ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  3. #3
    Join Date
    Feb 2006
    Posts
    31
    Plugin Contributions
    0

    Default Re: Currency redirection behaviour

    That was no help

    ...but thanks anyway :)

    So I seem to have it working and thought I would post up what I've done in case it's of use to anyone else. I'm no coder so please feel free to correct me and advise if there's any issues.

    Objective: to add some currency icons to my header so a customer can change their currency, and also not be redirected off the page they were on.

    the file I edited is tpl_header.php. Copy this to your own template directory and edit.

    The added code I put just before these lines:

    <br class="clearBoth" />
    <!--eof-branding display-->

    Added this code:

    <fieldset id="currencyBox">
    <legend style="font-weight: normal;" align="center">Currency</legend>
    <form action="<?=$_SERVER['REQUEST_URI']?>" method=post>
    <input type="image" src="includes/templates/yourtemplate/images/icons/ausflag.gif" alt="Australian Dollars" name="AUD">
    <input type="image" src="includes/templates/yourtemplate/images/icons/usaflag.gif" alt="US Dollars" name="USD">
    </form>
    </fieldset>

    <?php
    if($_POST["AUD_x"]) {
    $_SESSION["currency"]="AUD"; }
    elseif($_POST["USD_x"]) {
    $_SESSION["currency"]="USD"; }
    ?>

    In my example I only have 2 currencies named AUD and USD. You'll need to alter the code to match the currencies you've created. Also you'll need to alter the <input... lines and change "yourtemplate" to the name of your template folder.

    Then add some flag pictures into the includes/templates/yourtemplate/images/icons/ folder and adjust the .gif names accordingly. You can style and position your currency box by adding a #currencyBox section to your stylesheet. Here's mine:

    #currencyBox {
    border: 1px solid #ff0000;
    font-size: 1.1em;
    font-weight: normal;
    float: right;
    margin-right: 70px;
    margin-top: 20px;
    color: #ff0000;
    width: 106px;
    }

    All comments welcome.

    Cheers.
    Last edited by acetate; 21 Feb 2007 at 06:48 AM.

 

 

Similar Threads

  1. Wierd IE 7 behaviour
    By Protostack in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 12 Oct 2008, 10:15 AM
  2. Strange Behaviour
    By rogers in forum Setting Up Categories, Products, Attributes
    Replies: 0
    Last Post: 4 Apr 2008, 11:57 AM
  3. Crazy behaviour
    By scottb in forum General Questions
    Replies: 4
    Last Post: 27 Nov 2006, 01:26 AM
  4. Odd behaviour in IE
    By lasmit in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 26 Jul 2006, 08:41 PM

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