Skip to content

[Bug]: Configurable Orders table displays TWD totals as USD when currency_code is hidden #16202

Description

@haruselect-tech

Bug description

With Medusa v2.18.0 and featureFlags.view_configurations: true, the default configurable Orders table displays order totals as USD even when the store, region, and order all use TWD.

The underlying order data is correct. This appears to be a display-only issue in the Admin configurable table.

System information

  • Medusa version: 2.18.0
  • @medusajs/dashboard: 2.18.0
  • Node.js: 22.23.1
  • Database: PostgreSQL on Railway
  • Production OS: Linux container
  • Browser: Chrome

Configuration

featureFlags: {
  view_configurations: true,
}

The relevant data is equivalent to:

{
  "store_currency": "twd",
  "region_currency": "twd",
  "order": {
    "currency_code": "twd",
    "total": 2040
  }
}

Steps to reproduce

  1. Configure the store and a region to use TWD.
  2. Enable featureFlags.view_configurations.
  3. Create an order in TWD.
  4. Open the Admin Orders page at /app/orders using the default code-defined view.
  5. Keep total visible and currency_code hidden, which are the default column visibility settings returned for the Orders view.
  6. Observe the currency shown for the total.

Expected behavior

The order total should be formatted using the order currency, for example NT$2,040 / TWD.

Actual behavior

The Orders table displays $2,040.00 USD.

Suspected root cause

The Orders columns endpoint marks total as visible by default and currency_code as hidden. The configurable table only requests the visible fields, so row.currency_code is absent when the total cell is rendered.

In v2.18.0, CurrencyRenderer then falls back to USD:

const CurrencyRenderer: CellRenderer = (value, row, _column, _t) => {
  return <TotalCell currencyCode={row.currency_code || "USD"} total={value} />
}

Source: https://github.com/medusajs/medusa/blob/v2.18.0/packages/admin/dashboard/src/lib/table/cell-renderers.tsx#L445-L447

This means any non-USD order can be rendered as USD whenever currency_code is not included in the selected fields.

Suggested fix

When a currency-rendered field such as total is selected, automatically include its currency-code dependency in the query, even if that dependency is not a visible column. Alternatively, allow the column metadata to specify the currency source field and avoid a hard-coded USD fallback when the source field is missing.

Additional context

  • The Admin Orders API returns the correct currency_code: "twd" for the affected orders.
  • The store and region both use TWD.
  • The legacy/non-configurable Orders table includes the currency code and formats the same orders correctly.
  • No customer or monetary data is corrupted; this is an Admin display issue.
  • A public reproduction repository is not available, but the behavior is reproducible with the default configurable Orders view in v2.18.0.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions