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

# $wsSubshop - Subshop

With the `$wsSubshop` module, you can access subshop data. Typical use cases are language switchers or links between different country and language versions of the shop. In this section, you will learn how to read out subshop information and link between subshops.

***

## Module overview

**Example / excerpt of** `$wsSubshop`

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

**JSON output**

```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{
  "currentTime": "2026-06-26T09:18:59.000Z",
  "id": "deutsch",
  "language": {
    "isoCode": "DE",
    "name": "Deutsch"
  },
  "subshopUrl": "ƒ()",
  "subshops": ["deutsch"],
  "timeZone": "Europe/Berlin"
}
```

Note: `ƒ()` denotes a function.

**Variables and methods overview**

| **Name**       | **Type** | **Description**                                            |
| -------------- | -------- | ---------------------------------------------------------- |
| `id`           | string   | ID of the current subshop.                                 |
| `currentTime`  | string   | Current timestamp in ISO 8601 format.                      |
| `timeZone`     | string   | Time zone configured in the shop (e.g. `"Europe/Berlin"`). |
| `language`     | map      | Map with language information of the subshop.              |
| `isoCode`      | string   | ISO language code (e.g. `"DE"`, `"EN"`).                   |
| `name`         | string   | Name of the language (e.g. `"Deutsch"`, `"Englisch"`).     |
| `subshops`     | array    | List of all available subshop IDs.                         |
| `subshopUrl()` | string   | Returns the URL to the home page of the specified subshop. |

***

## Templates

Subshop data is typically used in the following places:

* Header: language switcher between different subshops.
* Footer: links to other country/language versions of the shop.
* Content: country-specific notices or adjustments.

***

## Variables

### \$wsSubshop.id

Returns the ID of the current subshop.

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
Current subshop: {{= $wsSubshop.id }}
```

### \$wsSubshop.currentTime

Returns the current timestamp in ISO 8601 format (e.g., `2026-06-26T09:18:59.000Z`). Format this value with the global function [`dateFmt()`](/en/frontend/referenz/funktionen#datefmt) into a readable date or time.

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{{= $wsSubshop.currentTime | dateFmt("%Y") }}
```

This is how you output, for example, the current year, e.g. for a copyright notice in the footer.

### \$wsSubshop.timeZone

Returns the time zone configured in the shop (e.g., `Europe/Berlin`). This is the time zone that [`dateFmt()`](/en/frontend/referenz/funktionen#datefmt) uses when no separate time zone is specified during formatting.

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
Shop time zone: {{= $wsSubshop.timeZone }}
```

### \$wsSubshop.language

Returns a map with language information of the current subshop.

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
Language: {{= $wsSubshop.language.name }} ({{= $wsSubshop.language.isoCode }})
```

#### \$wsSubshop.language.isoCode

Returns the ISO language code of the current subshop.

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
ISO code: {{= $wsSubshop.language.isoCode }}
```

#### \$wsSubshop.language.name

Returns the name of the language of the current subshop.

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
Current language: {{= $wsSubshop.language.name }}
```

### \$wsSubshop.subshops

Returns a list of all available subshop IDs. Useful for creating a language switcher or country selector.

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{{ foreach $myShopId in $wsSubshop.subshops }}
  {{= $myShopId }}
{{ /foreach }}
```

***

## Methods

### \$wsSubshop.subshopUrl()

Returns the URL to the home page of the specified subshop. The URL automatically takes into account the correct domain and path of the target subshop.

**Signature**\
`$wsSubshop.subshopUrl(subshopId)`

**Return value**\
`string` - URL of the specified subshop.

**Parameters**

| **Name**    | **Type** | **Required** | **Description**           |
| ----------- | -------- | ------------ | ------------------------- |
| `subshopId` | string   | yes          | ID of the target subshop. |

**Example** that outputs the URL of a subshop.

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
URL: {{= $wsSubshop.subshopUrl('english') }}
```

***

## Actions

No actions are available for `$wsSubshop`.

***

## Examples

### Set HTML lang attribute

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
<html lang="{{= $wsSubshop.language.isoCode | lower }}">
```

### Display current language

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
<p>You are in the shop: {{= $wsSubshop.language.name }}</p>
```

### Output the current year in the footer

Combines `currentTime` with `dateFmt`, for example to keep a copyright line always up to date.

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
<p>© {{= $wsSubshop.currentTime | dateFmt("%Y") }} My online shop</p>
```

**Result**

```text theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
© 2026 My online shop
```

***

# Related links

* [general - General shop settings](/en/konfiguration/general-allgemeine-shopeinstellungen)
* [Functions](/en/frontend/referenz/funktionen) - global functions such as `dateFmt`, `isoToUnix`, and `unixToIso` for processing timestamps.
