B-219 Sec-55 Noida, India
+918010221733

Setting the Default Currency for a User in Magento

This won’t alter the base price in the system but it will set the start price for a user. Simply add this to the top of /template/directory/currency.phtml

    $currentCurrency = $this->getCurrentCurrencyCode();

    if(!isset($currentCurrency)) $currentCurrency = ‘NA’;

    $currencies = array(“GBP”,”USD”,”EUR”);

    if(isset($_GET[‘cy’]))
    {
    if (in_array(strtoupper($_GET[‘cy’]),$currencies)) {
    if(strtoupper($_GET[‘cy’]) != $currentCurrency)
    {
    header(“Location: “.$this->helper(‘directory/url’)->getSwitchCurrencyUrl().”currency/”.$_GET[‘cy’]);
    exit;
    }
    }
    }

Then, you can do something with the domains where a .co.uk site will redirect to the .com with ?cy=GBP at the end.

(Visited 31 times, 1 visits today)

Leave a reply

You must be logged in to post a comment.