Documentation Index
Fetch the complete documentation index at: https://docs.khaime.com/llms.txt
Use this file to discover all available pages before exploring further.
WooCommerce Multicurrency
The plugin converts all WooCommerce prices to the customer’s selected currency in real-time.How It Works
- Currency detection: Customer’s currency is detected by IP geolocation on first visit
- Price conversion: All product prices, shipping, and totals are converted using live exchange rates
- Currency switcher: Floating widget lets customers manually change currency
- Checkout: Payment is processed in the customer’s currency via the appropriate gateway
Currency Detection Priority
The plugin determines the customer’s currency using this priority:- Currency switcher selection — if the customer has manually chosen a currency
- WooCommerce session — persisted from a previous page in the same session
- IP geolocation — automatically detected via the Khaime API on first visit
- Baseline currency — your store’s default currency (fallback)
Exchange Rates
Rate Sources
The plugin uses the Khaime pricing API as the primary rate source. This ensures display prices match exactly what the customer will be charged — including any fees or markup configured in your Khaime dashboard. If the pricing API is unavailable, the plugin falls back to the Khaime localization API for raw exchange rates.Caching
Rates are cached with volatility-aware durations to balance accuracy and performance:| Currency Type | Examples | Cache Duration |
|---|---|---|
| Stable | USD, EUR, GBP, CAD, AUD, CHF, JPY | 60 minutes |
| Volatile | NGN, GHS, KES, ZAR, UGX, XOF | 15 minutes |
What Gets Converted
- Product prices (regular, sale, and variation prices)
- Cart item prices and subtotals
- Shipping rates
- Order totals
- Currency symbols
- Mini-cart totals
- WAPF / Product Add-Ons pricing labels
Page Caching Compatibility
The plugin is designed to work with full-page caching (Varnish, WP Super Cache, etc.):- On cacheable pages (shop, product listings, home), prices are converted client-side via JavaScript after page load. This means CDN and page caches can serve a single cached version to all visitors.
- On transactional pages (cart, checkout, my-account), prices are converted server-side so WooCommerce’s totals engine calculates correctly.
Third-Party Plugin Compatibility
WAPF (WooCommerce Advanced Product Fields)
The plugin fully supports WAPF addon pricing:- Addon prices (e.g. ”+$500.00 for Clothing”) are converted to the customer’s currency
- Cart labels showing addon prices are re-formatted at display time
- The checkout total includes all converted addon amounts
Page Builders & Custom Themes
If your theme renders prices using non-standard markup, use the Custom Price Selectors setting to tell the converter where to find them. See Configuration → Custom Price Selectors.Currency Switching
When a customer selects a new currency from the switcher:- The selection is saved as a cookie (30-day expiry)
- The page reloads to ensure all components update consistently
- Mini-cart fragments are refreshed with the new currency
Currency Switcher Widget
Floating Switcher (Auto-injected)
Appears in the bottom-right corner on configured pages. Shows country flags and currency codes. Automatically inherits your theme’s accent color.Shortcode
Widget
Add via Appearance → Widgets → Khaime Currency Switcher. Supports dropdown or button style.Supported Currencies
USD, EUR, GBP, NGN, GHS, KES, ZAR, CAD, AUD, NZD, CHF, JPY, SEK, DKK, NOK, PLN, INR, BRL, MXN, SGD, HKD, RWF, TZS, UGX, XOF, XAFError Handling
If the exchange rate API is unavailable when a customer tries to switch currency:- The currency switch is blocked rather than showing prices with a wrong symbol
- The switcher reverts to the previous currency
- Errors are logged to WooCommerce → Status → Logs
₦ symbol with USD amounts).
Troubleshooting
Prices not converting
- Check the API connection: KhaimePay Settings → Test Connection
- Flush caches: KhaimePay Settings → Flush All Caches
- Check WooCommerce logs: WooCommerce → Status → Logs → khaimepay
Prices showing very large numbers
- Usually indicates double conversion. Flush all caches from the KhaimePay settings page and clear your browser cookies.
- Ensure your baseline currency matches your Khaime dashboard setting.
Mini-cart showing wrong currency symbol
- The mini-cart uses WooCommerce cart fragments that may be cached in the browser. Switching currency triggers a page reload which refreshes the fragments. If it persists, use Flush All Caches in KhaimePay settings and clear your browser cache.
