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

# BD- (tiered prices)

> The tags for tiered prices: iterate over a product's price tiers, output quantity, price and savings, and display the base price per unit.

A tiered price makes a product cheaper from a certain quantity onwards: one piece for 10 euros, from ten pieces for 9 euros, from fifty for 8 euros. The tags with the prefix `BD-` output these tiers on the product detail view.

The tiers are maintained in the technical product data field `BulkDiscount`. In the template, you iterate over them with `BD-Data` and output quantity, price and savings for each iteration.

Guide: Product prices, section Tiered prices · Reference: PR-BulkDiscount

## The tier table

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
<table>
   <tr>
      <th>ab Menge</th>
      <th>Stückpreis</th>
      <th>Sie sparen</th>
   </tr>

   {@BD-Data}
      <tr>
         <td>~BD-Quantity~</td>
         <td>~BD-Price~ ~WS-CurrencySymbol~</td>
         <td>
            {BD-Discount}
               ~BD-Discount~ ~WS-CurrencySymbol~
               {BD-DiscountRate}(~BD-DiscountRate~ %){/BD-DiscountRate}
            {/BD-Discount}
         </td>
      </tr>

      {BD-BasePriceInfo}
         <tr><td colspan="3">Grundpreis: ~BD-BasePriceInfo~</td></tr>
      {/BD-BasePriceInfo}
   {/@BD-Data}
</table>
```

> [!NOTE]
>
> The first tier is usually quantity 1 with the regular price and savings of zero. That is why `BD-Discount` and `BD-DiscountRate` are bracketed: both only apply for a value greater than zero, so in the first row the column stays empty instead of showing "0,00".

## The tags

| Tag | Single tag | Area tag | Negative area tag | Loop tag |
| - | - | - | - | - |
| `BD-Data` | – | – | – | yes |
| `BD-Quantity` | yes | – | – | – |
| `BD-Price` | yes | yes | yes | – |
| `BD-Discount` | yes | yes | yes | – |
| `BD-DiscountRate` | yes | yes | yes | – |
| `BD-BasePriceInfo` | yes | yes | yes | – |
| `BD-IPart(Price)` | yes | – | – | – |
| `BD-FPart(Price)` | yes | – | – | – |
| `BD-Price_prec` | yes | – | – | – |
| `BD-Discount_prec` | yes | – | – | – |
| `BD-AltCurrencyPrice` | yes | yes | yes | – |
| `BD-AltCurrencyDiscount` | yes | yes | yes | – |

They are permitted on the product detail view (`ws_product.htm`). `BD-IPart(Price)` and `BD-FPart(Price)` are permitted on all templates on which product data appears.

### BD-Data

Loop over all tiers of a product. With n tiers, the area is run through n times.

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{@BD-Data}
   <!-- Angaben zur einzelnen Staffel -->
{/@BD-Data}
```

> [!WARNING]
>
> `BD-Data` is exclusively a loop tag. To check whether a product has tiered prices at all, use `PR-BulkDiscount`.

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{PR-BulkDiscount}
   <table>
      {@BD-Data}
         <!-- die Staffeltabelle -->
      {/@BD-Data}
   </table>
{/PR-BulkDiscount}

{!PR-BulkDiscount}
   Für dieses Produkt gibt es keine Staffelpreise.
{/!PR-BulkDiscount}
```

### BD-Quantity

Outputs the quantity from which this tier applies.

> [!NOTE]
>
> The output takes into account the decimal places configured for this product's quantity. For a product sold by the metre, it therefore shows 2,5 and not 2.

### BD-Price

Outputs the unit price of this tier.

> [!NOTE]
>
> The price already includes the customer-specific product discount, if one is stored for the logged-in buyer. It is therefore not necessarily the same price that a visitor who is not logged in sees.

> [!WARNING]
>
> When used as an area tag, `BD-Price` always applies, regardless of the price. It is therefore not suitable as a check, only for output.

### BD-Discount and BD-DiscountRate

`BD-Discount` outputs the savings compared to the regular price as an amount, `BD-DiscountRate` the same savings as a percentage. As area tags, both only apply if the savings are greater than zero.

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{BD-Discount}
   Sie sparen ~BD-Discount~ ~WS-CurrencySymbol~
   {BD-DiscountRate}, das sind ~BD-DiscountRate~ %{/BD-DiscountRate}
{/BD-Discount}
```

> [!NOTE]
>
> The amount is in the shop's currency and not necessarily in euros. Therefore, place `~WS-CurrencySymbol~` after it instead of a fixed symbol.

### BD-BasePriceInfo

Outputs the base price information of this tier, i.e. the price per unit. It only applies if base price information is maintained for this entry in the product data field `BulkDiscount`.

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

{!BD-BasePriceInfo}
   Keine Grundpreisinformation verfügbar.
{/!BD-BasePriceInfo}
```

> [!WARNING]
>
> Base price information is required by law for many product types. It is maintained per tier, so it may only exist for individual tiers. Therefore, check each tier individually rather than once for the whole product.

## Splitting and formatting prices

### BD-IPart(Price) and BD-FPart(Price)

Output the integer part and the fractional part of the tier price respectively. Only the parameter `Price` is permitted.

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
<span class="preis">
   <span class="ganz">~BD-IPart(Price)~</span><span class="cent">~BD-FPart(Price)~</span>
</span>
```

> [!NOTE]
>
> This is intended for typographic presentation in which the cents appear smaller or superscript. For everything else, `BD-Price` is the simpler choice.

### BD-Price\_prec and BD-Discount\_prec

Output the tier price and savings with the number of decimal places configured in the shop configuration for the `_prec` tags.

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
<span data-preis="~BD-Price_prec~">~BD-Price~ ~WS-CurrencySymbol~</span>
```

> [!NOTE]
>
> These two tags are intended for further processing, for example for calculations in the template or for passing to a third-party system. For display to the buyer, `BD-Price` and `BD-Discount` remain the right choice.

## Alternative currency

| Tag | Corresponds to |
| - | - |
| `BD-AltCurrencyPrice` | `BD-Price` |
| `BD-AltCurrencyDiscount` | `BD-Discount` |

Both accept a three-letter ISO currency code as a parameter. Without a parameter, they convert into the currently selected alternative currency.

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{@BD-Data}
   ab ~BD-Quantity~ Stück:
   ~BD-Price~ ~WS-CurrencySymbol~
   {BD-AltCurrencyPrice}
      (~BD-AltCurrencyPrice~ ~WS-AltCurrencySymbol~)
   {/BD-AltCurrencyPrice}
{/@BD-Data}
```

> [!NOTE]
>
> As with all alternative currency tags, the area applies as soon as a conversion factor exists, not only for an amount greater than zero.

Reference: AltCurrency- (alternative currency)

## Related topics

* Guide: Product prices
* Guide: Defining discounts
* Reference: PR-BulkDiscount
* Reference: AltCurrency- (alternative currency)


## Related topics

- [AltCurrency- (Alternative currency)](https://dokumentation.websale.de/en/v8s/referenz/tags/altcurrency.md)
- [Price formatting](https://dokumentation.websale.de/en/v8s/preise/preisformatierungen.md)
- [Prices and costs](https://dokumentation.websale.de/en/v8s/preise/preise-und-kosten.md)
- [Price calculation method](https://dokumentation.websale.de/en/v8s/preise/preisberechnungsmethode.md)
- [Order data overview](https://dokumentation.websale.de/en/v8s/materialien/uebersicht-bestelldaten.md)


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