We also created a list for use by the USMW German Division called the USMW Price List (Eur). It is identical to the defaultPriceList but converted into Euros. Both of these lists have a locale property. For the USMW German prices, we set this to de_DE_EURO since we defined the prices in Euros. For the US dollar prices, the locale is en_US since the US dollar is the default currency for this locale. The correct price list must be assigned to each user’s profile.

A user’s price list is defined by the parent organization’s contract. Thus, even if a registered user changes his language of choice for viewing the site, he will still see the same prices.

We created a new class, atg.droplet.CurrencyConversionFormatter, that combines properties of CurrencyFormatter, CurrencyConversionTagConverter, and EuroTagConverter.

We used this droplet to convert and format the price lists in US dollars and Euros. It takes as inputs the amount to convert, its original locale (that of the price list), and its target locale.

There is one output parameter (in oparam="output") called formattedCurrency:

<droplet bean="/atg/dynamo/droplet/CurrencyConversionFormatter">
  <param name="currency" value="param:price.listPrice">
  <param name="locale" value="en_US">
  <param name="targetLocale" value="de_DE_EURO">
  <param name="euroSymbol" value="&euro;">
  <oparam name="output">
    <valueof param="formattedCurrency" valueishtml>no price</valueof>
  </oparam>
</droplet>

For more information on CurrencyConversionFormatter, see the Using Price Lists section of the Using and Extending Pricing Services chapter of the ATG Commerce Programming Guide.

 
loading table of contents...