> ## Documentation Index
> Fetch the complete documentation index at: https://dokumentation.websale.de/llms.txt
> Use this file to discover all available pages before exploring further.

# Currencies

> How to define the base currency of a shop, offer alternative currencies for information, control currency formatting, and enable Swiss rappen rounding.

First define the currencies required in your shops. Via your online service area in the Configuration service, you can conveniently and quickly define new currencies that can be displayed to your customers in the online shop or even offered for selection. If you use multiple subshops, individual currencies can be assigned to each subshop.

![Waehrungen Waehrungsrechner](https://mintcdn.com/websaleag-44ee7ea6/skgEiyBpkjLxNR4u/images/waehrungen_waehrungsrechner.png?fit=max\&auto=format\&n=skgEiyBpkjLxNR4u\&q=85\&s=e0acb870be304c7ba030179be8b96c6d)

Below, we explain in detail how to define your base currency and additional currencies for your shop. This is followed by currency formatting for automatically generated elements and the rounding logic for Switzerland.

## Base currency

The base currency of a shop is the currency in which the prices of the products and other costs, for example shipping and payment costs, are stored.

### Step 1: Defining the base currency in the shop configuration

The base currency is defined in the shop configuration `shop.config` in the `<Currency-Txt>` section.

Example: The base currency of the shop should be Euro.

```ini theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
<Currency-Txt>
   Name-!      = EUR
   Symbol      = &euro;
</Currency-Txt>
```

Reference: Section Currency-Txt&#x20;

### Step 2: Displaying the base currency in the shop

For displaying the base currency in the shop, you have two options: displaying it as a word, for example EUR, or as a symbol, for example €.

| Display | Tag |
| - | - |
| as a word | `~WS-Currency~` |
| as a symbol | `~WS-CurrencySymbol~` |

> [!TIP]
>
> Always use these two tags to display the base currency in your shop. This lets you change the base currency, if needed, with a single setting in the shop configuration `shop.config`. Adjusting the templates is then no longer necessary.

Reference: WS-Currency

Reference: WS-CurrencySymbol&#x20;

## Alternative currency

In addition to prices in the base currency, prices in other currencies can be displayed in the shop for the buyer's information. To display prices in other currencies, WEBSALE V8s accesses a conversion table containing the most frequently required conversion rates. This table is always kept up to date daily. However, you can also use a shop-specific conversion table.

The price display in an alternative currency serves only to inform your buyer. Invoicing in the shop continues to be done in the base currency.

There are two ways to select the currency. You can offer your customer a drop-down list with various currencies from which they can choose their desired currency. After the selection, all relevant costs are additionally displayed informationally.

Alternatively, you can determine the origin of your customer via GeoIP and display all relevant costs in the origin currency when the shop is called. With this type of display, it cannot be guaranteed that the applicable currency of the buyer is always determined, since GeoIP determination is not 100 percent accurate.

### Step 1: Activation

The alternative currency display must be activated for your shop by WEBSALE AG. Please contact your WEBSALE contact.

### Step 2: Settings in the shop configuration

In the `<AlternativeCurrency>` section of your shop configuration `shop.config`, you fundamentally define whether the display of an alternative currency is possible or not.

Via the `GeoIP-Allow` parameter, you can define whether the currency should be displayed automatically based on the origin of your customer.

With the `<+Entry>` subsections, you define the alternative currencies that are to be available for selection in your shop and that can be displayed. As with the base currency, you can have the alternative currency displayed both as text, for example US dollar, and as a symbol, for example `$`. Enter your desired values behind the `Txt` and `Symbol` parameters.

Example: The display of the alternative currency should not be controlled automatically via GeoIP determination. US dollar (USD) and British pound (GBP) should be offered as alternative currencies.

```ini theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
<AlternativeCurrency>

   Allow                      = yes
   GeoIP-Allow                = no
   SelectBoxMode              = Text
   SelectBoxOnchange          = submit();
   NoAlternativeCurrency-Txt  = Do not display an alternative currency

   <+Entry>
      ISO                     = USD
      Txt                     = US dollar
      Symbol                  = $
   </+Entry>

   <+Entry>
      ISO                     = GBP
      Txt                     = British pound
      Symbol                  = &pound;
   </+Entry>

</AlternativeCurrency>
```

Reference: Section AlternativeCurrency&#x20;

### Step 3: Integrating the drop-down list

The drop-down list for the alternative currency can be integrated on the product detail view (`ws_product.htm`) and the cart page (`ws_basket.htm`).

Insert the tag `WS-AltCurrencyList` to display the drop-down list within the `<form>` of both templates.

The tag `WS-AltCurrencyList` automatically generates a `<select>` drop-down list. The class `select_alternative_currency` is assigned to this HTML element. Add this class to your styles file and assign your desired CSS properties.

The data from the `<+Entry>` subsections of the `<AlternativeCurrency>` section of the shop configuration `shop.config` is used as the `<option>` entries.

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
<form action="Form of the template" method="POST">
   {WS-AltCurrencyList}
      ~WS-AltCurrencyList~
      <noscript><input type="submit" name="~BT-AltCurrency~" value="Select currency"></noscript>
   {/WS-AltCurrencyList}
</form>
```

Reference: FORM-Basket

Reference: FORM-Product

Reference: Special tags for displaying prices in alternative currency&#x20;

### Step 4: Displaying the alternative currency

For displaying the alternative currency in the shop, you have two options: displaying it as a word, for example USD, or as a symbol, for example `$`.

| Display | Wrapping |
| - | - |
| as a word | `{WS-AltCurrency}~WS-AltCurrency~{/WS-AltCurrency}` |
| as a symbol | `{WS-AltCurrencySymbol}~WS-AltCurrencySymbol~{/WS-AltCurrencySymbol}` |

### Step 5: Displaying the alternative prices

In addition to the currency, of course, the converted price must also be displayed. To do so, it is necessary to integrate the special alternative price tags in the desired places. Which prices can be displayed as alternative prices can be found in the list of special tags for displaying prices in alternative currency.

Example: Displaying the product price in the base currency and in the alternative currency.

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
Display of the product price in the base currency:
~PR-Price~ ~WS-CurrencySymbol~
{WS-AltCurrency}
   Display of the product price in alternative currency:
   ~PR-AltCurrencyPrice~ ~WS-AltCurrencySymbol~
{/WS-AltCurrency}
```

Pointer: Displaying shipping costs in the alternative currency

Pointer: Displaying payment costs in the alternative currency

Pointer: Displaying chargeable additional services in the alternative currency&#x20;

Reference: PR-Price&#x20;

### Step 6: Testing the display via GeoIP

To test the display of the alternative currency via GeoIP, you must open the shop directly from the desired IP address. So, if you want to test whether the alternative currency Swiss francs (CHF) is displayed correctly when a Swiss customer visits, you must open the shop from a Swiss IP address.

> [!NOTE]
>
> A test using the GeoIP test mode is not possible. With this test mode, only the `WS-GeoIPCountryCode()` wrappings for the country check can be tested, see guide [Switching the shop's test modes on and off](https://dokumentation.websale.de/en/testmodi-des-shops-ein-ausschalten.md).

Reference: WS-GeoIPCountryCode()&#x20;

## Currency formatting for automatically generated elements

Thanks to the free positioning of the tags for displaying the currency, you can decide for yourself whether the currency is displayed before or after the price. In addition, the tags give you the free choice of whether to display the currency as text or as a symbol. These statements generally apply to all price and currency displays of WEBSALE V8s.

In exceptional cases, however, it may be that you cannot place the tags for both the currency and the price yourself on the template. In these cases, the shop generates these elements automatically.

So that you still have the option to influence the positioning of the currency symbol, there is a setting option in your shop configuration `shop.config`. In the `<PriceFormat>` section, you can use the `JoinCurrency` and `JoinCurrencySymbol` parameters to define whether the currency is displayed before or after the price.

Example: The currency should always be displayed before the price.

```ini theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
<PriceFormat>
   ...
   JoinCurrency         = ~WS-Currency~ ~WS-Price~
   JoinCurrencySymbol   = ~WS-CurrencySymbol~ ~WS-Price~
   ...
</PriceFormat>
```

Reference: Section PriceFormat

Reference: WS-Price&#x20;

## Rounding logic for Switzerland (rappen rounding)

If you operate a shop in which the Swiss franc (CHF) applies as the currency, you can switch the rounding of the totals to the rounding logic commonly used in Switzerland.

In this case, the total is multiplied by 20, then the result is commercially rounded to 0 decimal places and then divided by 20.

This rounding logic is only applied to the total. All other prices, subtotals, discounts, and VAT amounts remain unaffected.

For this purpose, add the parameter `TotalSumSwissRounding-Allow` in the shop configuration `shop.config` and assign it the value `yes`:

```ini theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
<OrderConditions>
 ...
 TotalSumSwissRounding-Allow = yes
 ...
</OrderConditions>
```

Reference: Section OrderConditions&#x20;


## Related topics

- [AltCurrency- (Alternative currency)](https://dokumentation.websale.de/en/v8s/referenz/tags/altcurrency.md)
- [Configuration currency.dat](https://dokumentation.websale.de/en/v8s/referenz/konfigurationen/konfiguration-currency-dat.md)
- [Prices, taxes, and currency](https://dokumentation.websale.de/en/v8s/referenz/konfigurationen/shopkonfiguration-shop-config/preise-steuern-und-waehrung.md)
- [Vouchers with multiple currencies](https://dokumentation.websale.de/en/v8s/gutscheine-anbieten/gutscheine-mit-mehreren-waehrungen.md)
- [finance - Currencies & taxes](https://dokumentation.websale.de/en/konfiguration/finance-wahrungen-steuern.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.