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

# DC- (comparisons and other tags)

> Compare numbers and strings in the template, build links, prepare tag results as parameters, and handle other individual tasks.

This page covers the design control tags that do not belong to any of the larger groups: the comparison tags with which a template formulates conditions, and a handful of tags for individual, clearly defined tasks.

## Comparing numbers

Six range tags compare numeric values. All arguments support tag-in-tag, so usually two tag results or a tag result and a fixed value are compared.

| Tag | Shows the area if |
| - | - |
| `DC-CompareDigitLT(a,b)` | a is less than b |
| `DC-CompareDigitLTE(a,b)` | a is less than or equal to b |
| `DC-CompareDigitGT(a,b)` | a is greater than b |
| `DC-CompareDigitGTE(a,b)` | a is greater than or equal to b |
| `DC-CompareDigitIB(a,b,c)` | b is greater than a and less than c |
| `DC-CompareDigitIBE(a,b,c)` | b is greater than or equal to a and less than or equal to c |

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{DC-CompareDigitLT($PR-Price$,100.00)}
   <p>Versandkostenfrei ab 100,00 €. Es fehlen nur noch wenige Euro.</p>
{/DC-CompareDigitLT($PR-Price$,100.00)}

{DC-CompareDigitIBE(10.00,$PR-Price$,100.00)}
   <p>Dieses Produkt liegt in unserer beliebtesten Preisklasse.</p>
{/DC-CompareDigitIBE(10.00,$PR-Price$,100.00)}
```

> [!WARNING]
>
> Pay attention to the position of the value being checked. With `LT`, `LTE`, `GT` and `GTE` it comes first; with `IB` and `IBE` it is in the middle between the lower and upper limit.

> [!WARNING]
>
> Write fixed numbers without thousands separators and with a period as the decimal separator, so `100.00` and not `100,00`. The comma separates the arguments.

> [!NOTE]
>
> The negative bracketing is always the exact inverse. `{!DC-CompareDigitLT($PR-Price$,100.00)}` therefore applies to a price of exactly 100.00 as well as to a higher one. If you mean "greater than", use `DC-CompareDigitGT()`.

Guide: Displaying areas depending on logical comparisons

## Comparing strings

`DC-CompareStringInList()` checks whether the first value matches the second or appears in a list.

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{DC-CompareStringInList($A-Country$,Deutschland)}
   <p>Lieferung innerhalb von zwei Werktagen.</p>
{/DC-CompareStringInList($A-Country$,Deutschland)}
```

Multiple values are passed as a comma-separated list in quotation marks.

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{DC-CompareStringInList($A-Country$,"Deutschland,Schweiz,Belgien")}
   <p>Für dieses Land gelten unsere Standardversandkosten.</p>
{/DC-CompareStringInList($A-Country$,"Deutschland,Schweiz,Belgien")}
```

> [!WARNING]
>
> Without the quotation marks, the shop reads three arguments instead of two, and the tag has no effect. They are only needed for multiple values, but they do no harm with a single one either.

> [!NOTE]
>
> The comparison checks for a complete match. If the value only needs to contain a part, use `DC-FPX_contains()` instead.

> [!WARNING]
>
> If the list gets long, the tag quickly exceeds the limit of 128 characters and is output as plain text in the shop. In that case, build the list with `DC-FPX_append()` and pass it as tag-in-tag.

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
~DC-FPliste_reset~
~DC-FPliste_append(Deutschland,Schweiz,)~
~DC-FPliste_append(Belgien,Niederlande,Luxemburg)~

{DC-CompareStringInList($A-Country$,"$DC-FPliste$")}
   <p>Für dieses Land gelten unsere Standardversandkosten.</p>
{/DC-CompareStringInList($A-Country$,"$DC-FPliste$")}
```

Reference: DC- (free parameters and session parameters)

## Using a tag result as a parameter

Tag-in-tag only works with single tags without their own argument. A tag such as `DC-FPX_IndexOf()`, which itself needs parentheses, therefore cannot be written into another tag as `$…$`.

For this case, there is a pair: `DC-WSTagParameter-prepare` encloses the tag and captures its result, and `DC-WSTagParameter-use` then inserts it as a parameter.

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
~DC-FPurl_set($WS-RequestURI$)~

{DC-WSTagParameter-prepare}
   ~DC-FPurl_IndexOf(?)~
{/DC-WSTagParameter-prepare}

~DC-FPurl_slice(0,$DC-WSTagParameter-use$)~
~DC-FPurl~   <!-- die Adresse ohne ihre Parameter -->
```

> [!NOTE]
>
> The content of the `prepare` area is never output. It serves solely to generate the result.

> [!WARNING]
>
> `DC-WSTagParameter-prepare` cannot be nested. A second `prepare` inside the first does not work. If you need two prepared values, save the first with `DC-FPX_set()` and then prepare the second.

The same pattern is used to pass a calculated address to `ContentControl-SetHeader_Location()`.

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{DC-WSTagParameter-prepare}
   ~PR-Link(12345)~
{/DC-WSTagParameter-prepare}

~ContentControl-SetHeader_Location($DC-WSTagParameter-use$)~
```

Reference: ContentControl-SetHeader\_Location()

## Building links

Three tags assemble an address from a base and any number of parameters.

| Tag | Effect |
| - | - |
| `DC-CustomLink_SetLink()` | sets the base address and discards any previously set one |
| `DC-CustomLink_AppendParameter()` | appends a name-value pair |
| `DC-CustomLink` | outputs the finished address |

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
~DC-CustomLink_SetLink($PR-Link$)~
~DC-CustomLink_AppendParameter($TAF-Name$,$TAF-Value$)~

<a href="~DC-CustomLink~">Dieses Produkt weiterempfehlen</a>
```

> [!NOTE]
>
> The shop sets the question mark or the ampersand itself, depending on whether the base address already carries parameters. You no longer have to handle the order manually, and `WS-EnsureNextLinkContainsURLParams` is not needed for this.

> [!NOTE]
>
> The value is automatically URL-encoded. Therefore, pass it as plain text and not already encoded, otherwise it will be encoded a second time.

For each additional parameter, use `_AppendParameter()` once more.

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
~DC-CustomLink_SetLink($CAT-Link$)~
~DC-CustomLink_AppendParameter(quelle,newsletter)~
~DC-CustomLink_AppendParameter(kampagne,fruehjahr)~
```

> [!WARNING]
>
> The documentation has so far listed the first tag as `DC-CustomerLink_SetLink()`. The correct name is `DC-CustomLink_SetLink()`, like the other two tags in the group.

Reference: TAF- (Tell-A-Friend)

## Other tags

### DC-3ISOCodeToCountry()

Translates a three-letter country ISO code into the country name from the country configuration. If the code is unknown, the tag outputs nothing.

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
~DC-DynamicLoop1_set($PR-PrimeShoppingBillCountries$)~

{DC-DynamicLoop1}
   {@DC-DynamicLoop1}
      ~DC-3ISOCodeToCountry($DC-DynamicLoop1_data$)~
   {/@DC-DynamicLoop1}
{/DC-DynamicLoop1}
```

### DC-RedeemVoucher

Redeems an entered or passed voucher, provided it has not yet been redeemed. This allows you to redeem a voucher via a deep link.

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
~CheckURLParam-TouchData(voucher_number)~

{CheckURLParam-DataOK}
   ~DC-RedeemVoucher~
{/CheckURLParam-DataOK}
```

> [!WARNING]
>
> The tag triggers an action as soon as it is parsed. Therefore, always enclose it so that it only appears where a redemption is actually intended.

Reference: CHECK- (URL and cookie data)

### DC-ResetActiveCatIndex

Resets the internally stored active category. As a result, no entry in the category menu appears as selected anymore.

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
~DC-ResetActiveCatIndex~
```

> [!NOTE]
>
> Useful on pages that do not belong to any category, for example the basket or login. Without the tag, the most recently visited category remains highlighted there.

### DC-RecalculatePayDeliv

Has payment methods and shipping methods rechecked and recalculated. The tag is not described in the previous documentation, but it exists in the shop.

> [!WARNING]
>
> The tag intervenes in the calculation of the current order. Only use it after consulting WEBSALE AG.

### DC-ResetAddressErrorFlags

Resets the error flags of the billing address input. Also not described in the previous documentation, but it exists in the shop.

### DC-QuantityInputPrintDepVarIndex

Controls the output of the variant index for quantity input fields. Also not described in the previous documentation, but it exists in the shop.

### Test mode tags

Two further tags only take effect when the shop is running in test mode and output nothing otherwise.

| Tag | Purpose |
| - | - |
| `DC-ParserStatistics` | outputs the statistics of the template parser |
| `DC-PrintShopConfig` | outputs the loaded shop configuration |

> [!WARNING]
>
> Both tags reveal internal information. They belong in a test system and never in a template that is delivered in live operation.

## Overview of the tags

| Tag | Single tag | Range tag | Negative range tag | Loop tag |
| - | - | - | - | - |
| `DC-CompareDigitLT()` | – | yes | yes | – |
| `DC-CompareDigitLTE()` | – | yes | yes | – |
| `DC-CompareDigitGT()` | – | yes | yes | – |
| `DC-CompareDigitGTE()` | – | yes | yes | – |
| `DC-CompareDigitIB()` | – | yes | yes | – |
| `DC-CompareDigitIBE()` | – | yes | yes | – |
| `DC-CompareStringInList()` | – | yes | yes | – |
| `DC-WSTagParameter-prepare` | – | yes | – | – |
| `DC-WSTagParameter-use` | yes | – | – | – |
| `DC-CustomLink_SetLink()` | yes | – | – | – |
| `DC-CustomLink_AppendParameter()` | yes | – | – | – |
| `DC-CustomLink` | yes | – | – | – |
| `DC-3ISOCodeToCountry()` | yes | yes | yes | – |
| `DC-RedeemVoucher` | yes | – | – | – |
| `DC-ResetActiveCatIndex` | yes | – | – | – |
| `DC-RecalculatePayDeliv` | yes | – | – | – |
| `DC-ResetAddressErrorFlags` | yes | – | – | – |
| `DC-QuantityInputPrintDepVarIndex` | yes | – | – | – |
| `DC-ParserStatistics` | yes | – | – | – |
| `DC-PrintShopConfig` | yes | – | – | – |

All tags are permitted in all templates.

## Related topics

* Guide: Displaying areas depending on logical comparisons
* Reference: TAF- (Tell-A-Friend)
* Reference: DC- (free parameters and session parameters)
* Reference: ContentControl- (redirect concept for content from third-party systems)
* Reference: CHECK- (URL and cookie data)


## Related topics

- [DC- (date and time)](https://dokumentation.websale.de/en/v8s/referenz/tags/dc/datum-und-zeit.md)
- [DC- (free parameters and session parameters)](https://dokumentation.websale.de/en/v8s/referenz/tags/dc/parameter.md)
- [Counters and comparisons in the template](https://dokumentation.websale.de/en/v8s/fortgeschrittene-designtechniken/zaehler-und-vergleiche-im-template.md)
- [PRC- (Product comparison)](https://dokumentation.websale.de/en/v8s/referenz/tags/prc-produktvergleich.md)
- [DC- (counters and calculations)](https://dokumentation.websale.de/en/v8s/referenz/tags/dc/rechnen.md)


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