> ## 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.

# $wsConfig - Configuration

> Read the shop's global configuration data in the frontend: countries, currencies, payment and shipping methods, salutations, languages, and more.

With the `$wsConfig` module, you read the shop's configuration data in the frontend, for example the available countries, the currency, the payment and shipping methods, and the configured salutations and titles.

This page is about reading the configuration. The configuration itself is maintained in the admin interface or [via code](/en/frontend/die-basics/konfiguration-per-code), not through this module.

***

## Basic concept

`$wsConfig` is a read-only module. It reflects the configuration stored in the shop at the time the page is built. The values change only when the configuration is changed and not as a result of a customer action.

The variables can be grouped as follows:

* **Lists for forms** – [`countries`](#wsconfig-countries), [`salutation`](#wsconfig-salutation), [`title`](#wsconfig-title), [`listElements`](#wsconfig-listelements): populate, e.g., select fields in address and login forms.
* **Checkout options** – [`payments`](#wsconfig-payments), [`shippingMethods`](#wsconfig-shippingmethods): the available payment and shipping methods.
* **Display** – [`currency`](#wsconfig-currency): currency symbol and codes.
* **Behavior and security** – [`passwordChecks`](#wsconfig-passwordchecks), [`passwordReset`](#wsconfig-passwordreset), [`directOrder`](#wsconfig-directorder), [`redirects`](#wsconfig-redirects), [`emails`](#wsconfig-emails).
* **Insert codes** – [`inserts`](#wsconfig-inserts): settings for [insert codes](/en/frontend/funktionsubersicht/werbemittelkennzeichnung) (active, separator, position, default code).

### Format currency

The `currency` filter (`| currency`) outputs an amount **with** the currency symbol already included (e.g. `1,500.00 €`). For this reason, do **not** use [`currency.symbol`](#wsconfig-currency) in addition to `| currency` – otherwise the symbol will appear twice. You only need `currency.symbol` if you format a value yourself or display the symbol on its own.

***

## Module overview

**Example / excerpt of** `$wsConfig`

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{{= $wsConfig | json }}
```

**JSON output**

```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{
  "countries": [ { "isoAlpha2": "...", "isoAlpha3": "...", "isoNum": "...", "name": "..." } ],
  "currency": { "symbol": "...", "isoCode": "...", "isoNum": "..." },
  "directOrder": { "initialNumber": 0, "maximalNumber": 0, "refreshedNumber": 0, "itemNumberFields": [...] },
  "emails": [...],
  "inserts": { "enabled": false, "separator": "...", "position": "...", "defaultInsertCode": "..." },
  "listElements": { "bill": { }, "delivery": { } },
  "passwordChecks": { "maxLength": { "len": 0 }, "minLength": { "len": 0 } },
  "passwordReset": { "checkLoginID": false, "checkOldPassword": false },
  "payments": [ { "id": "...", "name": "...", "description": "...", "image": "..." } ],
  "redirects": [...],
  "salutation": { "codeList": [ { "code": "...", "text": "..." } ] },
  "shippingMethods": [ { "id": "...", "name": "...", "description": "...", "image": "...", "link": "...", "type": "...", "group": "..." } ],
  "shippingMethodGroups": [ { "id": "...", "name": "...", "description": "...", "image": "...", "link": "..." } ],
  "title": { "codeList": [ { "code": "...", "text": "..." } ] }
}
```

**Variables overview**

| **Variable**           | **Type** | **Description**                                                                 |
| ---------------------- | -------- | ------------------------------------------------------------------------------- |
| `countries`            | array    | Configured countries (structure see below).                                     |
| `currency`             | map      | Currency data (symbol, codes).                                                  |
| `salutation`           | map      | Configured salutations (under `codeList`).                                      |
| `title`                | map      | Configured titles (under `codeList`).                                           |
| `payments`             | array    | Configured payment methods (structure see below).                               |
| `shippingMethods`      | array    | Configured shipping methods (structure see below).                              |
| `shippingMethodGroups` | array    | Groups of shipping methods (structure see below).                               |
| `listElements`         | map      | Address type options for forms (`bill`, `delivery`).                            |
| `passwordChecks`       | map      | Password length rules.                                                          |
| `passwordReset`        | map      | Password reset settings.                                                        |
| `directOrder`          | map      | Direct order settings.                                                          |
| `emails`               | array    | Email configurations.                                                           |
| `redirects`            | array    | Redirect configurations.                                                        |
| `inserts`              | map      | Settings for insert codes (active, separator, position, default code).          |
| `b2bSubAccounts`       | map      | B2B sub-account settings (`subAccountsEnabled`, `adminCanEditMemberAddresses`). |

***

## Templates

The configuration data can be used on any page. Typical use cases: forms (country and salutation selection), checkout (payment and shipping methods), and price display (currency).

***

## Variables

### \$wsConfig.countries

Returns the configured countries. Use the list, for example, to populate a country select field in an address form.

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{{ foreach $country in $wsConfig.countries }}
  {{= $country.name }} ({{= $country.isoAlpha2 }})
{{ /foreach }}
```

#### Properties of a country

| **Property** | **Type** | **Description**                             |
| ------------ | -------- | ------------------------------------------- |
| `name`       | string   | Name of the country.                        |
| `isoAlpha2`  | string   | ISO-2 country code (e.g. `"DE"`, `"AT"`).   |
| `isoAlpha3`  | string   | ISO-3 country code (e.g. `"DEU"`, `"AUT"`). |
| `isoNum`     | string   | ISO numeric code (e.g. `"276"`, `"040"`).   |

### \$wsConfig.currency

Returns the currency data. To display an amount, you generally use the `currency` filter (see [Format currency](#format-currency)).

#### Properties of `$wsConfig.currency`

| **Property** | **Type** | **Description**                                  |
| ------------ | -------- | ------------------------------------------------ |
| `symbol`     | string   | Currency symbol (e.g. `€`).                      |
| `isoCode`    | string   | ISO currency code (e.g. `"EUR"`).                |
| `isoNum`     | string   | ISO numeric code of the currency (e.g. `"978"`). |

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
Currency: {{= $wsConfig.currency.isoCode }} ({{= $wsConfig.currency.symbol }})
```

### \$wsConfig.salutation

Returns the configured salutations. The actual list is found under `salutation.codeList`. Use it, for example, to populate a salutation select field.

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{{ foreach $salutation in $wsConfig.salutation.codeList }}
  {{= $salutation.text }}
{{ /foreach }}
```

#### Properties of an entry in `salutation.codeList`

| **Property** | **Type** | **Description**                                                 |
| ------------ | -------- | --------------------------------------------------------------- |
| `code`       | string   | Salutation code (e.g. `"1"`, `"2"`).                            |
| `text`       | string   | Display text (e.g. `"Mr."`, `"Mrs."`, `"Family"`, `"Company"`). |

### \$wsConfig.title

Returns the configured titles. The list is found under `title.codeList`. The structure is analogous to `salutation`.

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{{ foreach $title in $wsConfig.title.codeList }}
  {{= $title.text }}
{{ /foreach }}
```

#### Properties of an entry in `title.codeList`

| **Property** | **Type** | **Description**                                       |
| ------------ | -------- | ----------------------------------------------------- |
| `code`       | string   | Title code (e.g. `"1"`).                              |
| `text`       | string   | Display text (e.g. `"Dr."`, `"Prof."`; can be empty). |

### \$wsConfig.payments

Returns the configured payment methods. Use it to display the available payment methods.

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{{ foreach $payment in $wsConfig.payments }}
  {{= $payment.name }}: {{= $payment.description }}
{{ /foreach }}
```

#### Properties of a payment method

| **Property**  | **Type** | **Description**                                                 |
| ------------- | -------- | --------------------------------------------------------------- |
| `id`          | string   | ID of the payment method (e.g. `"paypalCheckout"`, `"stripe"`). |
| `name`        | string   | Name of the payment method.                                     |
| `description` | string   | Description of the payment method.                              |
| `image`       | string   | Image URL of the payment method.                                |
| `discount`    | float    | Discount of the payment method.                                 |
| `provider`    | string   | Provider of the payment method.                                 |
| `type`        | string   | Type of the payment method.                                     |
| `labels`      | array    | Labels of the payment method.                                   |
| `displayInfo` | array    | Additional display information (see note).                      |

`displayInfo` is only populated if the [displayPaymentTypes](/en/konfiguration/payment-zahlungsmethoden#3-payment-payment-zahlungsarten-anlegen) parameter has been configured for the payment method. Each entry contains `name`, `description` and `image`.

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{{ foreach $payment in $wsConfig.payments }}
  {{ foreach $info in $payment.displayInfo }}
    {{= $info.name }} – {{= $info.description }}
  {{ /foreach }}
{{ /foreach }}
```

### \$wsConfig.shippingMethods

Returns the configured shipping methods.

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{{ foreach $shipping in $wsConfig.shippingMethods }}
  {{= $shipping.name }} ({{= $shipping.type }})
{{ /foreach }}
```

#### Properties of a shipping method

| **Property**  | **Type** | **Description**                                   |
| ------------- | -------- | ------------------------------------------------- |
| `id`          | string   | ID of the shipping method (e.g. `"dhl"`).         |
| `name`        | string   | Name of the shipping method.                      |
| `description` | string   | Description of the shipping method.               |
| `image`       | string   | Image URL of the shipping method.                 |
| `link`        | string   | Link to the shipping method (e.g. tracking page). |
| `type`        | string   | Type of the shipping method (e.g. `"standard"`).  |
| `group`       | string   | Assigned shipping method group (can be `null`).   |

<Note>
  The **shipping costs** are not part of the configuration. They depend on the basket and are determined via [`$wsCheckout.getShippingCost(shippingMethodId)`](/en/frontend/referenz/module/wscheckout#wscheckout-getshippingcost).
</Note>

### \$wsConfig.shippingMethodGroups

Returns the configured shipping method groups. A group can bundle several shipping methods (e.g. by provider or delivery type). Which group a shipping method is assigned to is indicated in the `group` field of the respective shipping method (see [Properties of a shipping method](#properties-of-a-shipping-method)).

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{{ foreach $group in $wsConfig.shippingMethodGroups }}
  {{= $group.name }}: {{= $group.description }}
{{ /foreach }}
```

#### Properties of a group

| **Property**  | **Type** | **Description**                                                                                         |
| ------------- | -------- | ------------------------------------------------------------------------------------------------------- |
| `id`          | string   | ID of the group configuration.                                                                          |
| `nodeId`      | string   | ID of the configuration node of this group, as the second parameter for `$wsOptions.get(name, nodeId)`. |
| `name`        | string   | Name of the group.                                                                                      |
| `description` | string   | Description of the group.                                                                               |
| `image`       | string   | Image URL (link) of the group.                                                                          |
| `link`        | string   | Link of the group.                                                                                      |

### \$wsConfig.listElements

Returns the address type options for forms, separated by `bill` (billing address) and `delivery` (shipping address), for example private / company.

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{{ foreach $list in $wsConfig.listElements.bill }}
  <select name="addressType">
    {{ foreach $option in $list.values }}
      <option value="{{= $option.value }}"{{ if $option.value == $list.defaultValue }} selected{{ /if }}>
        {{= $option.name }}
      </option>
    {{ /foreach }}
  </select>
{{ /foreach }}
```

#### Properties of an entry in `listElements.bill` / `.delivery`

| **Property**   | **Type** | **Description**                 |
| -------------- | -------- | ------------------------------- |
| `defaultValue` | string   | Preselected value (e.g. `"1"`). |
| `values`       | array    | Options, each `{ name, value }` |

### \$wsConfig.passwordChecks

Returns the length rules for passwords. Use them, for example, to display the allowed length in a registration or password form, or to validate client-side.

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
Password length: {{= $wsConfig.passwordChecks.minLength.len }} to {{= $wsConfig.passwordChecks.maxLength.len }} characters
```

#### Properties of `$wsConfig.passwordChecks`

| **Property**    | **Type** | **Description**          |
| --------------- | -------- | ------------------------ |
| `minLength.len` | int      | Minimum password length. |
| `maxLength.len` | int      | Maximum password length. |

### \$wsConfig.passwordReset

Returns the password reset settings.

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{{ if $wsConfig.passwordReset.checkOldPassword }}
  <!-- Old password required when resetting -->
{{ /if }}
```

#### Properties of `$wsConfig.passwordReset`

| **Property**       | **Type** | **Description**                               |
| ------------------ | -------- | --------------------------------------------- |
| `checkLoginID`     | bool     | Whether the login ID is checked on reset.     |
| `checkOldPassword` | bool     | Whether the old password is checked on reset. |

### \$wsConfig.directOrder

Returns the direct order settings (e.g. how many input lines are displayed).

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
Initial lines: {{= $wsConfig.directOrder.initialNumber }}
Max. lines: {{= $wsConfig.directOrder.maximalNumber }}
```

#### Properties of `$wsConfig.directOrder`

| **Property**       | **Type** | **Description**                         |
| ------------------ | -------- | --------------------------------------- |
| `initialNumber`    | int      | Number of initially displayed lines.    |
| `maximalNumber`    | int      | Maximum number of lines.                |
| `refreshedNumber`  | int      | Number of newly loaded lines.           |
| `itemNumberFields` | array    | Item number fields of the direct order. |

### \$wsConfig.inserts

Returns the settings for [insert codes](/en/frontend/funktionsubersicht/werbemittelkennzeichnung). In particular, use `enabled` to only show output related to insert codes when the feature is active in the shop.

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{{ if $wsConfig.inserts.enabled }}
  <!-- Output related to the insert code -->
{{ /if }}
```

#### Properties of `$wsConfig.inserts`

| **Property**        | **Type** | **Description**                                                                                  |
| ------------------- | -------- | ------------------------------------------------------------------------------------------------ |
| `enabled`           | bool     | Whether insert codes are active in the shop. Only then are codes captured, resolved, and output. |
| `separator`         | string   | Separator between product number and code (e.g. `-`).                                            |
| `position`          | string   | Position of the code relative to the product number: `before` or `after`.                        |
| `defaultInsertCode` | string   | Default code that applies when no code or an invalid code has been captured. Can be empty.       |

### \$wsConfig.emails

Returns the email configurations.

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{{= $wsConfig.emails | json }}
```

### \$wsConfig.redirects

Returns the redirect configurations.

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{{= $wsConfig.redirects | json }}
```

***

## Methods

No methods are available for `$wsConfig`.

***

## Actions

No actions are available for `$wsConfig`.

***

## Examples

### Country select field

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
<select name="country">
  {{ foreach $country in $wsConfig.countries }}
    <option value="{{= $country.isoAlpha2 }}">{{= $country.name }}</option>
  {{ /foreach }}
</select>
```

**Result** <br />A select field with all configured countries. The value is the ISO-2 code.

### Salutation select field

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
<select name="salutation">
  {{ foreach $salutation in $wsConfig.salutation.codeList }}
    <option value="{{= $salutation.code }}">{{= $salutation.text }}</option>
  {{ /foreach }}
</select>
```

**Result** <br />A select field with all configured salutations.

### List payment methods

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{{ foreach $payment in $wsConfig.payments }}
  <p>{{= $payment.name }} – {{= $payment.description }}</p>
{{ /foreach }}
```

**Result** <br />All configured payment methods with name and description.

### Display the currency correctly

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
Subtotal: {{= $wsBasket.totalGross | currency }}
```

**Result** <br />The amount is output with the currency symbol (e.g. `1,500.00 €`).

***

## Related links

* [Configuration](/en/konfiguration) – where the values read here are maintained.
* [Configuration via code](/en/frontend/die-basics/konfiguration-per-code) – configuration directly in the template.
* [\$wsCheckout](/en/frontend/referenz/module/wscheckout) – determines, among other things, the shipping costs per shipping method.
* [Insert code](/en/frontend/funktionsubersicht/werbemittelkennzeichnung) – overview of insert codes, whose settings are provided by `$wsConfig.inserts`.
* [ISO 3166-1 code list](https://en.wikipedia.org/wiki/ISO_3166-1) – meaning of the country codes.
