Update Prices on Page

The <IgPrice/> Component

The <IgPrice/> component is recommended as it automatically applies assigned test prices and uses Integration Mode styling.

The useIgPrices() Hook

The useIgPrices() hook may be used to pull updated prices based on the user's test group and then render the result however your storefront needs.

Internationalization

  1. Set a default activeCurrencyCode prop for the provider. USD will be used by default if not set.

  2. If necessary, update activeCurrencyCode through context:

const { dispatchData } = useContext(IntelligemsContext);

dispatchData({
  type: "SET_ACTIVE_CURRENCY_CODE",
  payload: "EUR",
});
  1. Experiment currency is set through the Intelligems app. Prices for experiments with a currency that does not match activeCurrencyCode will return the original price.

Last updated