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

# SURCHARGE- (small quantity surcharge)

> Output the limit and amount of the small quantity surcharge in the template and distinguish whether the values come from the shop configuration or are stored on the customer account.

For small orders, the effort for packaging and shipping is out of all proportion to the value of the goods. That is why the shop system has the small quantity surcharge: if the value of the goods stays below a certain limit, a fixed amount is added to the invoice.

Two numbers describe this completely, namely the limit and the amount. Both can come from the shop configuration or be stored on the individual customer account. This is exactly what the eight tags on this page make visible.

Guide: Small quantity surcharge

> [!WARNING]
>
> These tags describe the **rule**, not the result. They tell you from when and at what amount a surcharge would be charged, regardless of what is currently in the basket. Whether a surcharge was actually calculated for the current order and how high it was is shown in the basket totals. The previous documentation does not separate these and thus suggests that `SURCHARGE-Value` is the calculated surcharge.

Reference: BASKET- (basket totals)

## The two values

| Tag | Returns |
| - | - |
| `SURCHARGE-Limit` | the limit below which a surcharge applies |
| `SURCHARGE-Value` | the amount of the surcharge |

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{SURCHARGE-Limit}
   <p>
      Bei Bestellungen unter ~SURCHARGE-Limit~ ~WS-Currency~ berechnen wir einen
      Mindermengenzuschlag von ~SURCHARGE-Value~ ~WS-Currency~.
   </p>
{/SURCHARGE-Limit}
```

> [!NOTE]
>
> Both tags already output the amount in the shop's number format, that is, with the configured decimal and thousands separators and two decimal places. The currency symbol is not included; use `WS-Currency` for that.

> [!NOTE]
>
> As a bracketing, both apply if their value is not zero. A limit of zero means that no small quantity surcharge is provided at all, and an amount of zero means that a limit exists but nothing is charged. Both cases can thus be caught cleanly.

> [!WARNING]
>
> The limit alone decides whether any calculation takes place at all. If it is set to zero, no check takes place, even if an amount is stored. The previous documentation does not mention this dependency.

## Where the values come from

Limit and amount are determined separately from each other. For each of the two: if the buyer is logged in and there is a value in their customer account, that value counts. Otherwise, the value from the shop configuration counts.

| Tag | Applies if |
| - | - |
| `SURCHARGE-Limit_IsConfigDependent` | the limit comes from the shop configuration |
| `SURCHARGE-Limit_IsUserDependent` | the limit comes from the customer account |
| `SURCHARGE-Value_IsConfigDependent` | the amount comes from the shop configuration |
| `SURCHARGE-Value_IsUserDependent` | the amount comes from the customer account |

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{SURCHARGE-Value_IsUserDependent}
   <p class="hinweis">Für Ihr Konto gilt ein gesonderter Mindermengenzuschlag.</p>
{/SURCHARGE-Value_IsUserDependent}
```

> [!WARNING]
>
> Limit and amount can come from different sources. If only a different limit is stored in the customer account, `SURCHARGE-Limit_IsUserDependent` applies and at the same time `SURCHARGE-Value_IsConfigDependent`. Word the notice text accordingly, because "special conditions" only half fits this mixed case. The previous documentation describes the two pairs without mentioning that they are independent of each other.

> [!NOTE]
>
> The four tags are pure bracketings and are mutually exclusive in pairs. Instead of the negative bracketing of `_IsConfigDependent`, it is therefore better to use `_IsUserDependent`, which reads more clearly in the template.

### The technical codes

For each pair, there is a tag that outputs the same distinction as a number.

| Tag | Value |
| - | - |
| `SURCHARGE-Limit_Code` | `0` from the shop configuration, `1` customer-specific |
| `SURCHARGE-Value_Code` | `0` from the shop configuration, `1` customer-specific |

> [!NOTE]
>
> Both are exclusively single tags. For a case distinction in the template, use the four bracketings; the codes are better suited for passing to your own scripts.

> [!WARNING]
>
> The customer-specific value also applies if it is set to zero. A customer account with a stored surcharge of `0,00` therefore pays no small quantity surcharge, and `SURCHARGE-Value_IsUserDependent` still applies. An empty field in the customer account is something different from a stored zero; only the empty field leads back to the shop configuration.

## When the surcharge actually applies

For wording the texts in the template, it is helpful to know how the shop system calculates. Three conditions must be met at the same time.

| Condition | Meaning |
| - | - |
| The calculation basis is **below** the limit | exactly at the limit, no surcharge applies |
| The amount is greater than zero | otherwise there is nothing to charge |
| The basket contains at least one product that counts towards the basis | otherwise nothing is added |

> [!WARNING]
>
> The limit is not reached but undercut. Anyone who orders exactly the amount of the limit pays no surcharge. The wording "until it is reached" in the previous documentation is misleading at this point; this page says "below".

> [!NOTE]
>
> What the limit refers to is defined in the `SurchargeCalculation-Mode` parameter of the shop configuration. With `subtotal`, the default, it is the basket subtotal including all discounts. With `totalsumofproducts`, it is the sum of the individual items, skipping products that are excluded from the small quantity surcharge.

> [!NOTE]
>
> The product-side exclusion only takes effect in `totalsumofproducts` mode. If a basket consists exclusively of excluded products, the basis counts as empty and no surcharge is calculated. In `subtotal` mode, this exclusion is not evaluated.

> [!NOTE]
>
> The surcharge is rounded commercially and included in the total with its own VAT rate. Which rate that is is defined in the shop configuration under the global costs.

## Tags at a glance

| Tag | Single tag | Area tag | Negative area tag | Loop tag |
| - | - | - | - | - |
| `SURCHARGE-Limit` | yes | yes | yes | – |
| `SURCHARGE-Limit_Code` | yes | – | – | – |
| `SURCHARGE-Limit_IsConfigDependent` | – | yes | yes | – |
| `SURCHARGE-Limit_IsUserDependent` | – | yes | yes | – |
| `SURCHARGE-Value` | yes | yes | yes | – |
| `SURCHARGE-Value_Code` | yes | – | – | – |
| `SURCHARGE-Value_IsConfigDependent` | – | yes | yes | – |
| `SURCHARGE-Value_IsUserDependent` | – | yes | yes | – |

All eight tags are permitted on all templates and are not bound to any page state. They are therefore also available on the product page or in the customer account, not just in the basket.

## Related topics

* Guide: Small quantity surcharge
* Guide: Customer account
* Reference: BASKET- (basket totals)
* Reference: The parameters `Surcharge-Value`, `SurchargeLimit-Value` and `SurchargeCalculation-Mode` in the shop configuration


## Related topics

- [Order data overview](https://dokumentation.websale.de/en/v8s/materialien/uebersicht-bestelldaten.md)
- [checkout - Order flow](https://dokumentation.websale.de/en/konfiguration/checkout-bestellablauf.md)
- [Shopping basket and order process](https://dokumentation.websale.de/en/v8s/referenz/konfigurationen/shopkonfiguration-shop-config/warenkorb-und-bestellprozess.md)
- [Basket totals](https://dokumentation.websale.de/en/v8s/referenz/tags/basket/warenkorbsummen.md)
- [Order quantity of a product](https://dokumentation.websale.de/en/v8s/produkte/bestellmenge-eines-produkts.md)


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