douhao8456 2015-02-05 12:09
浏览 17
已采纳

magento的多种货币

I have website in magento.I set multiple currency in it.One is US dollar(default) and another is Japanese Yen. using these steps

setup multiple currency shop in Magento:-

– Go to System –> Configuration –> Currency Setup

– Under ‘Currency Options‘, select Allowed currencies.

The selected currencies will be displayed in currency dropdown in category and product listing page. Remember that your Base currency and Default display currency selection should also be selected in Allowed currencies.

– Click ‘Save Config‘ button.

– Go to System –> Manage Currency Rates

– Select Import Service. By default it is ‘Webservicex’.

– Click ‘Import‘ button. This will update the currency rates values.

– Click ‘Save Currency Rates‘ button.

At product listing page i see currency selection dropdown list in left sidebar at top. But i want to display multiple price for a product one in Japanese Yen and another in US dollar. Please Help.

  • 写回答

2条回答 默认 最新

  • dshu1235 2015-02-06 08:57
    关注

    Add this code where u want to display product multicurrencies product price.

    <?php
        //remember the current currency
        $currentCurrency = Mage::app()->getStore()->getCurrentCurrencyCode();
    
        //remember the current currency object
        $currentCurrencyObject = Mage::app()->getStore()->getCurrentCurrency();
    
        //get allowed currencies
        $allowedCurrencies = Mage::getModel('directory/currency')->getConfigAllowCurrencies();
        foreach ($allowedCurrencies as $currency) {
            //skip the current currency
            if ($currency != $currentCurrency) {
                //load the currency object
                $currObject = Mage::getModel('directory/currency')->load($currency);
                //change the store currency
                Mage::app()->getStore()->setCurrentCurrencyCode($currency);
                Mage::app()->getStore()->setCurrentCurrency($currObject);
                //show the price in the new currency
                echo $this->getPriceHtml($_product, true, '-clone-'.$currency);
            }
        }
    
        //reset the store currency
        Mage::app()->getStore()->setCurrentCurrencyCode($currentCurrency);
        Mage::app()->getStore()->setCurrentCurrency($currentCurrencyObject);
    ?>
    

    enter image description hereenter image description here

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 Python程序,深度学习,有偿私
  • ¥15 扫描枪扫条形码出现问题
  • ¥35 poi合并多个word成一个新word,原word中横版没了.
  • ¥15 【火车头采集器】搜狐娱乐这种列表页网址,怎么采集?
  • ¥15 求MCSCANX 帮助
  • ¥15 机器学习训练相关模型
  • ¥15 Todesk 远程写代码 anaconda jupyter python3
  • ¥15 我的R语言提示去除连锁不平衡时clump_data报错,图片以下所示,卡了好几天了,苦恼不知道如何解决,有人帮我看看怎么解决吗?
  • ¥20 关于URL获取的参数,无法执行二选一查询
  • ¥15 液位控制,当液位超过高限时常开触点59闭合,直到液位低于低限时,断开