37 votes
Accepted

Magento 2: get the current currency code

In a block In Magento 2, you can use the \Magento\Store\Model\StoreManagerInterface which is stored in an accessible variable $_storeManager for every class extending \Magento\Framework\View\Element\...
user avatar
25 votes

Currency Rate not importing correctly from Webservicex

The issue, as others have pointed out, is that the WebserviceX is now returning a -1 for all currency conversions. Until this is fixed I suggest you use another exchange API. I suggest Fixer.io. I ...
user avatar
  • 35.6k
19 votes
Accepted

Magento 2: How to get current Currency and symbol in PHTML File?

please note that creating this with objectManager, not the best practice $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $currencysymbol = $objectManager->get('Magento\Store\...
user avatar
17 votes
Accepted

How to change currency format in Magento 2?

create just simple module and overrider default *Format.php** file, app/code/Package/Modulename/etc/di.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"...
user avatar
14 votes

How to change a currency symbol in Magento

You can change the currency symbols from System->Manage Currency->Symbols.
user avatar
  • 195k
13 votes

Magento 2: How to get current Currency and symbol in PHTML File?

Another way to approach this would be to use the Pricing\Helper, this will both give you the currency symbol and format the number to the correct decimal place. $objectManager = \Magento\Framework\...
user avatar
  • 4,613
12 votes
Accepted

How To Change Base currency for a multi store site

I will paraphrase the answer of St0iK. You can't set different base currency per store, but you can do it per website. First you have to go to the admin panel -> System -> Configuration -> CATALOG -> ...
user avatar
  • 2,750
11 votes

Webservicex giving wrong EUR:USD conversion

There does seem to be an issue with the WebserviceX currency conversion service. I've knocked together an extension that integrates with the fixer.io service, which can act as an alternative: https://...
user avatar
11 votes
Accepted

Free currency converter fixer.io stopped working

The Free Currency Converter API module: app/code/MyCompany/FreeCurrencyConverter/etc/module.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:...
user avatar
  • 1,198
8 votes

How to use paypal for other currency in Magento2

Here is the example of use AED currency in PayPal. You can use same for other currencies. Follow this step to support other currencies in paypal: 1) Override Config.php and Nvp.php app/code/{...
user avatar
  • 21.5k
8 votes
Accepted

Magento2 - admin price input's are rounding value to 2 decimals

You may try the step below for this customization: I assume you are using a custom module name "Company_MyModle" step 1) Create a di.xml file under MAGETNTO-ROOT/app/code/Company/Company_MyModle/...
user avatar
7 votes

Magento 2 Get Currency Symbol from Currency Code

We can do this using Constructor injection. /** * @var \Magento\Framework\Locale\CurrencyInterface */ protected $_localeCurrency public function __construct( \Magento\Framework\Locale\...
user avatar
7 votes

How to add Space between Currency Symbol and Price in Magento 2?

Just do like above screenshot in Magento 2 admin and space will be shown in frontend.
user avatar
6 votes

Magento 2: get the current currency code

This takes inspiration from Magento\Framework\Pricing\Render\Amount and it's working good in my case (behaving like Magento): protected $_priceCurrency; public function __construct( ... \Magento\...
user avatar
  • 1,809
6 votes

Magento 2: How to get current Currency and symbol in PHTML File?

<?php $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $storeManager = $objectManager->get('\Magento\Store\Model\StoreManagerInterfa‌​ce'); $currencyCode = $storeManager-&...
user avatar
6 votes
Accepted

Magento 2 - Get currency of an order item

You can try: $order = $this->orderRepository->get($orderId); $order->getOrderCurrencyCode(); //$order->getBaseCurrencyCode(); //$order->getGlobalCurrencyCode(); Look at sales_order ...
user avatar
6 votes

convert amount form one currency to another currency in magento 2

You can use this code (or whole class) to convert from the one currency to another: <?php /** * Created by PhpStorm. * User: siarhey * Date: 8/26/17 * Time: 7:25 AM */ class ...
user avatar
5 votes
Accepted

currency position magento

Which language do you have set up on your store? It should be that file. The symbol below represents your currency symbol, change it's location. ¤ Then open your FTP tool or SSH and delete all ...
user avatar
  • 789
5 votes
Accepted

Webservicex giving wrong EUR:USD conversion

It's because of an error on webservicex website. Check this link: http://www.webservicex.net/CurrencyConvertor.asmx/ConversionRate?FromCurrency=EUR&ToCurrency=USD It shows "-1" as response, seems ...
user avatar
  • 168
5 votes

How to add Space between Currency Symbol and Price?

You have to add empty space after Currency Symbol (System > Manage Currency > Symbols). For example: PKR
user avatar
  • 4,592
5 votes

Magento 2: How to get current Currency and symbol in PHTML File?

create helper file with method: I believe it's right practice use Magento\Store\Model\StoreManagerInterface; use Magento\Directory\Model\CurrencyFactory; class Data { /** * @var ...
user avatar
5 votes

Magento 2 : How do conver price from any currency to base currency?

NOTE: In the example the amount in current store currency is converting to amount in base store currency. You can use this code to convert one currency to another: /** * @var \Magento\Store\Model\...
user avatar
5 votes
Accepted

Magento 2 How to change currency symbol position left to right

You can do it by writing single event observer Create registration file: Vendor\Module\registration.php <?php \Magento\Framework\Component\ComponentRegistrar::register( \Magento\...
user avatar
5 votes
Accepted

Show custom currency symbol in Magento2

You need add "symbol" in $currencyOptions array. Please add this below code in your observer file : <?php /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license ...
user avatar
  • 16.5k
4 votes

checkout in display currency

Paypal does not support INR. You can take a look at the supported paypal currencies in Mage_Paypal_Model_Config::$_supportedCurrencyCodes. To save you the trouble of looking here it is: protected $...
user avatar
  • 195k
4 votes

checkout in display currency

I hope this will help you, Add this in “models” section of your module config.xml <paypal> <rewrite> <standard>Yourpackage_Yourmodule_Model_Standard</standard> ...
user avatar
4 votes
Accepted

VARNISH, MAGENTO and CURRENCY

As the currency is stored in a cookie parameter, one solution is to add that value into the hash for the varnish lookup. sub vcl_hash { hash_data(req.url); if (req.http.host) { hash_data(req....
user avatar
  • 156
4 votes
Accepted

Currency Convertor

You cannot convert one price currency price to base currency. because magento did not calculate base currency rate from other current rate. Magento define a price in BASE currency which will ...
user avatar
  • 75.4k
4 votes

Currency Convertor

It is not possible to convert a price from current currency to base currency using Mage::helper('directory')->currencyConvert($amt, 'USD', 'INR') method because Magento doesn't find the row with "...
user avatar
  • 1,451
4 votes

Only one base currency is displaying in magento admin panel?

What I think has happened here is that the list of installed currencies has been edited. You can see this list under Advanced->System->Currency->Installed Currencies. What you can do here is ...
user avatar

Only top scored, non community-wiki answers of a minimum length are eligible