Währungen und Wechselkurse ausgeben

Gibt die in Ihrem Shop hinterlegten Währungen und Wechselkurse aus.

Snippet Code

/**
 * Get the base currency
 */
$baseCurrencyCode = Mage::app()->getBaseCurrencyCode();

/**
 * Get all allowed currencies
 * returns array of allowed currency codes
 */
$allowedCurrencies = Mage::getModel('directory/currency')->getConfigAllowCurrencies();

/**
 * Get the currency rates
 * returns array with key as currency code and value as currency rate
 */
$currencyRates = Mage::getModel('directory/currency')->getCurrencyRates($baseCurrencyCode, array_values($allowedCurrencies));

$allowedCurrencies = Mage::getModel('directory/currency')->getConfigAllowCurrencies();

/**
 * Get currency rates for Nepalese Currency
 */
$currencyRates = Mage::getModel('directory/currency')->getCurrencyRates('NPR', array_values($allowedCurrencies));

Autor

Sebastian

Ich interessiere mich für eCommerce-Themen, vor allem im Zusammenhang mit dem Shopsystem Magento Commerce sowie alles rund um Web-Entwicklung und den damit verbundenen Möglichkeiten.

Ähnliche Snippets


Warning: count(): Parameter must be an array or an object that implements Countable in /homepages/22/d75420123/htdocs/mag-tutorials.de/wp-content/themes/radiate-child/content-singlesnippet.php on line 51