Last updated

Country

The Country section provides tools for managing country and locale settings. Country selection affects pricing, currency, shipping options, and localized content throughout the shopping experience.


What's Included

FunctionDescription
getCountryCodeGet the current country code
updateLocaleSettingsUpdate country and language settings

Benefits

  • Localized Pricing — Prices display in the correct currency for the selected country
  • Shipping Options — Available shipping methods update based on country
  • Tax Calculations — Taxes are calculated correctly for the destination country
  • Content Localization — Product descriptions and UI elements adapt to the locale
  • Automatic Detection — Country can be auto-detected from visitor's IP location

Quick Example

// Get current country code
const countryCode = window.FairShareSDK.getCountryCode();
console.log('Country:', countryCode); // e.g., "US"

// Update country setting
await window.FairShareSDK.updateLocaleSettings({
  country: "CA"
});