We built DEV3 AI Multi Currency & Geo Pricing as a WooCommerce plugin in PHP with a React admin and a small storefront script. The core rule: every amount that reaches a shopper is either a product price or a plain amount, and each is converted once, in a request that is known to be shopper-facing.
Key design decisions
- Two kinds of conversion. Product prices get the exchange rate, the currency's exchange fee, any regional adjustment and a price-point rounding rule. Shipping, coupon amounts, minimum spends and fees are "plain": converted and rounded to the currency's decimals, never pushed to .99.
- Price-point rounding as a candidate search. A rule is a step and an ending (1 and 0.99 gives 22.99, 23.99; 100 and 80 gives ¥2,380). Round up, down or to the nearest candidate, with a small epsilon so 23.99 stays 23.99.
- Only convert where shoppers are. wp-admin, cron, WP-CLI, admin-side AJAX and non-store REST routes always see base prices, so orders, reports and product edits are never converted by accident.
- Convert once, cache per currency. Converted shipping rates are marked, packages and variation price hashes include the currency, and the cart hash varies by currency.
- The order keeps its currency. Orders are created in the shopper's currency, with the base currency and the exact effective rate saved as order meta for reports and audits.
- Page-cache safe. Price HTML is wrapped with the product ID; when a cached page was rendered for another currency, the browser fetches fresh prices from a same-origin, rate-limited, no-store endpoint. WP Rocket, LiteSpeed and WP Super Cache vary by the currency cookie.
Architecture
Rates come from Frankfurter (ECB data, free), the European Central Bank, Open Exchange Rates, ExchangeRate-API or Fixer on an hourly to weekly schedule, with manual overrides, a rate history and alerts when a rate moves more than a threshold. Geo detection uses CDN country headers or WooCommerce's MaxMind geolocation and/or the browser language, and each currency can own a list of countries. Merchants can set fixed prices per currency for any product or variation, limit payment gateways per currency, or let shoppers browse in their currency and pay in the store currency. The optional DEV3 AI tools draft rounding rules from real catalogue prices, regional price adjustments, plain-language rate explanations and checkout notices; nothing changes prices until the merchant clicks Apply. The API client, encrypted key storage and usage logs come from a shared core used across DEV3's plugins.