2015-02-05 2 views
0

У меня есть веб-сайт в magento.I установить несколько валют в нем. Один доллар США (по умолчанию), а другой - японская иена. используя эти шагиmulti currency in magento

установки мультивалютного магазин в 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. 

На странице со списком продуктов я увидеть список выбора раскрывающихся валют в левой боковой панели в верхней части. Но я хочу отобразить несколько цен для продукта в японской йене, а другой - в долларах США. Пожалуйста, помогите.

+0

Вы должны переусердствовать ездить файл продукта PHTML для достижения этой функциональности – Pundit

+0

могли бы вы объяснить это? – maddy

ответ

2

Добавить этот код, где u хочет отображать цену продукта с несколькими продуктами.

<?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 here enter image description here

1

Вы можете редактировать price.phtml и добавить другую валюту, чтобы показать,

round(Mage::helper('directory')->currencyConvert($amount, $_fromCurr, $_toCurr), 2) 

Вы должны обновить для вкл и налог с оборота, а также расчетов.