Magento: Adding current currency code infront of prices

Magento: Adding current currency code infront of prices

August 24, 2026 · Illustrated author avatarBy Stefan Bogdanescu
Magento: Adding current currency code infront of prices

Displaying Prices with Currency Codes in Magento

In this guide, we’ll walk you through how to display prices in your Magento storefront with the current currency code prefixed to them. This is a common requirement for e-commerce stores that offer multiple currencies.

Understanding the Default Magento Behavior

By default, Magento includes the currency symbol after the price value. For example, if AUD is the base currency and you set the store currency to USD, Magento will display prices like this:

$5.50

However, many merchants prefer a format where the currency code appears first, followed by the price and the currency symbol. The desired output should look something like this:

AUD $5.50

The Easy Way: Using a Magento Extension

Before we dive into custom code solutions, let’s explore an easy way to achieve our goal using an extension.

Laravel Company offers a wide range of high-quality Magento extensions, including one specifically designed for this purpose. The Currency Prefix extension adds the ability to display prices with the currency code prefixed.

To install it:

  1. Log in to your Magento admin panel.
  2. Navigate to System > Configuration.
  3. Under the General section, click on Design.
  4. In the Custom Design dropdown, select Current Configuration Scope.
  5. Click on Add CSS, enter your theme’s ID, and save.
  6. Log out of the admin panel and log back in to refresh settings.

The extension will automatically apply the changes globally across your storefront without requiring any additional configuration.

Customizing Magento Core Files (Advanced)

If you prefer a more hands-on approach or want to avoid using an external extension, you can modify Magento core files. However, this method requires careful coding and should be backed up before proceeding.

  1. Open the app/code/core/Mage/Catalog/Block/Product/Abstract.php file.
  2. Locate the _toHtml() method within the Mage_Catalog_Block_Product_Abstract class.
  3. Modify the code inside the foreach loop where prices are being prepared:
$price = $this->helper('catalogoutput')->formatPrice($varienProduct->getFinalPrice(), true, false);

Replace it with this:

$currencyCode = Mage::app()->getStore()->getCurrentCurrencyCode();
$price = $this->helper('catalogoutput')->formatPrice($varienProduct->getFinalPrice(), true, false) . ' ' . $currencyCode;
  1. Save the file and refresh your cache.

Conclusion

In this guide, we explored two methods to display prices with currency codes in Magento: using an extension from Laravel Company for a quick and easy solution, or modifying core files for those who prefer a custom approach.

Remember, changing core files should be done with caution and proper backups, as it may affect future updates. The extension route offers a more stable and supported method.

Now you can display prices in the desired format, enhancing the user experience on your e-commerce storefront. If you have any questions or need further assistance with Magento development, feel free to explore more resources at Laravel Company.

Happy coding!

Extensions Themes Admin Configuration

Our network