Multi-Currency Variations

Keyboard shortcuts
  • JNext lesson
  • KPrevious lesson
  • /Search lessons
  • EscClear search

The Multi-Currency Variations module lets you assign different currencies to individual product variations. Instead of selling everything in a single currency, you can offer USD, EUR, GBP, or any other currency on a per-variation basis.

Use Cases

  • International digital products — Sell a license in USD for US customers and EUR for European customers
  • Region-specific pricing — Different variations for different markets at localized prices
  • Multi-currency licensing — Software licenses priced in the buyer’s preferred currency

Enabling the Module

  1. Go to Fluent Cart > GT Extensions.
  2. Toggle on Multi-Currency Variations.
  3. In the module settings, select which currencies you want to offer.
  4. Click Save Settings.

Settings

  • Enabled Currencies — Select which currencies are available for variation assignment. The picker supports searching, “Select All”, and “Clear” actions. Each currency shows its code and symbol (e.g., USD — $).

By default, USD, EUR, and GBP are selected. You can enable any currency that Fluent Cart supports.

Assigning Currencies to Variations

After enabling the module:

  1. Go to Fluent Cart > Products and edit a product.
  2. In the product editor’s pricing section, each variation now shows a Currency dropdown.
  3. Select the desired currency for each variation.
  4. The selection saves automatically via AJAX.

The currency dropdown is injected into the Fluent Cart admin as a Vue component. It shows only the currencies you enabled in the module settings.

How It Works

Data storage:

Each variation’s currency is stored in the variation’s other_info JSON field under the key currency. This is a Fluent Cart variation field, not a separate database table.

Price display:

When the module detects a variation with a non-default currency, it replaces the currency symbol in the formatted price. For example, if your store default is USD but a variation is set to EUR, the price displays as €29.00 instead of $29.00.

This replacement happens in four locations:

  • fluent_cart/variation/formatted_price — Single product page price display
  • fluent_cart/api/variation/response — REST API responses
  • fluent_cart/cart/item_price — Cart line items
  • fluent_cart/checkout/line_item — Checkout page

Currency symbol mapping:

The module maintains an internal mapping of currency codes to symbols. If Fluent Cart’s CurrenciesHelper class is available, it uses that. Otherwise, it falls back to a built-in mapping covering major currencies.

Admin Widget

The admin currency widget is a Vue 3 component (multi-currency-admin-widget.js) that:

  1. Fetches available currencies from the REST API on load
  2. Renders a dropdown for each variation
  3. Saves selections via POST to /wp-json/gt-extensions-fluentcart/v1/variation/{id}/currency
  4. Shows loading and success states during save

The widget inherits Fluent Cart’s admin styling and appears inline within the existing product editor.

Frontend Behavior

On the frontend, when a customer selects a variation with a different currency:

  • The price updates to show the variation’s currency symbol
  • Cart calculations use the variation’s stated price (Fluent Cart handles payment processing)
  • The checkout page displays the correct currency per line item

REST API

The module registers two endpoints:

GET /wp-json/gt-extensions-fluentcart/v1/currencies

Returns the list of enabled currencies with their symbols. Used by the admin widget.

{
    "currencies": {
        "USD": {"code": "USD", "sign": "$"},
        "EUR": {"code": "EUR", "sign": "€"},
        "GBP": {"code": "GBP", "sign": "£"}
    },
    "defaultCurrency": "USD"
}

POST /wp-json/gt-extensions-fluentcart/v1/variation/{id}/currency

Updates the currency for a specific variation. Requires manage_options capability.

Parameters:

  • currency (string) — The currency code to assign

Important Notes

  • This module changes the display currency per variation. It does not perform currency conversion or exchange rate calculations.
  • Payment processing still happens through your configured payment gateway. Ensure your gateway supports the currencies you enable.
  • The module caches variation data in memory during each request to avoid repeated database queries.