мультивалютность в мадженто

У меня есть веб-сайт в 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

Решение

Добавьте этот код, где вы хотите отобразить мультивалютность продукта.

<?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);
?>

введите описание изображения здесь
введите описание изображения здесь

2

Другие решения

Вы можете отредактировать ваш price.phtml и добавить другую валюту для отображения,

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

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

1

По вопросам рекламы ammmcru@yandex.ru
Adblock
detector