Skip to content

Currency for ProcessWire

Currency (trk/processwire-currency) is the exact multi-currency arithmetic, exchange rate synchronization, and locale formatting engine for ProcessWire 3. Eliminate binary floating-point rounding bugs with integer minor-unit Money objects, sync official European Central Bank (ECB) and Central Bank of Turkey (TCMB) rates, query historical cross-rates, and manage visitor currency preferences from Setup -> Currencies.

Setup -> Currencies combines active currency management, official FX provider sync, and an interactive conversion preview.

Exact Minor-Unit Arithmetic

Perform add(), subtract(), multiply(), percentage(), largest-remainder allocate(), and applyIncrement() cash rounding backed by DecimalMath (ext-bcmath) and 5 RoundingMode strategies.

ECB, TCMB & Custom Providers

Sync daily or historical rates via EcbProvider, TcmbProvider (forex_selling with 5-business-day holiday lookback), ManualProvider, or custom ExchangeRateProviderInterface adapters over SSRF-hardened WireHttpTransport.

Historical FX & Cross-Rates

Persist locked currency-rate-history snapshots under CurrencyWriteLock and look up exact point-in-time rates via findRateOnOrBefore() and findCrossRateOnOrBefore().

Visitor Switcher & Formatting

Resolve visitor currency preferences via session and HttpOnly; SameSite=Lax pw_currency cookies and format prices with ext-intl MoneyFormatter (accounting, show_code, symbol_override).

Requirement Minimum Version Notes
PHP 8.4+ Requires ext-bcmath, ext-intl, and ext-curl (for outbound HTTPS rate sync).
ProcessWire 3.0.271+ Lazy 'autoload' => false boot with pull-discovery metadata (reactCapabilities, entriesBlueprints, entriesHooks).
Required Modules Inertia, React, Entries Backed by 3 Entries blueprints (currency-settings, currency-currencies, currency-rate-history).
Companion Module ProcessCurrency Installed automatically at Setup -> Currencies.

Next steps