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

# Time-based promotional prices

> Time-based promotional prices replace a product's standard price for a defined period. This guide shows how to output them in the template.

Time-based promotional prices are prices that are only valid within a defined period. The shop automatically switches to the promotional price at the stored point in time and back to the standard price after the promotion ends.

In the Admin Interface, the feature is called Scheduled prices, technically `scheduledPrices`. A single entry is referred to as a promotional price on this page.

This guide describes how to display a running promotional price in the shop. Where the prices are maintained is covered at the end in the section [Where promotional prices are maintained](#where-promotional-prices-are-maintained).

## What is available in the template

| **Field**       | **Content**                                                                                  |
| --------------- | -------------------------------------------------------------------------------------------- |
| `price`         | The currently valid price. If a promotion is running, this is the promotional price.         |
| `rawPrice`      | The standard price, regardless of running promotions. Can be used as a strike-through price. |
| `promotionInfo` | The promotion text, if one has been maintained. Only available while a promotion is running. |

These fields belong to the product object. They are therefore available everywhere a product is displayed, for example in category lists, search results, watchlists, and cart items.

Every other price field of the shop can also contain its own promotional prices. For these fields, the `getFullPriceInfo()` function returns the same three values. For set products, the values `setPrice`, `setRawPrice`, `setOrgPrice`, `setDiscount`, and `setDiscountPrice` are added.

<Warning>
  Outputting the start and end of a promotion is not yet available in the template.
</Warning>

## Outputting the price with a strike-through price and promotion text

`rawPrice` is always set, even when no promotion is running. Without the corresponding check in the template, the same price would be shown twice on every product, one of them struck through.

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{{ if $cProduct.rawPrice > $cProduct.price }}
	<span class="wsPriceOld">{{= $cProduct.rawPrice | currency }}</span>
	<span class="wsPriceNow">{{= $cProduct.price | currency }}</span>
	{{ var $cSalePercentage = (($cProduct.rawPrice - $cProduct.price) / $cProduct.rawPrice * 100)|round()|preparedFormat("amount") }}
	<span class="wsPriceBadge">- {{= $cSalePercentage }} %</span>
{{ else }}
	<span class="wsPriceNow">{{= $cProduct.price | currency }}</span>
{{ /if }}

{{ if $cProduct.promotionInfo }}
	<span class="wsPriceBadge">{{= $cProduct.promotionInfo }}</span>
{{ /if }}
```

**Result** <br />While a promotion is running, the standard price is shown as a strike-through price, the savings in percent, and the promotional price. If no promotion is running, only the standard price is shown. The promotion text has its own condition because not every promotion has a maintained promotion text.

## Where promotional prices are maintained

Promotional prices are maintained in the Admin Interface on the product's detail page in the "Scheduled prices" tab, with a separate table per price field. An entry consists of the price, the period, and an optional promotion text. Multiple entries can be stacked one after another, and the shop switches between them automatically.

Maintenance via the API is described in the section [Time-controlled prices (promotional prices)](/en/schnittstellen/admin-interface-api/api-referenz-produkte#zeitgesteuerte-preise-aktionspreise) of the API reference.

## Terms and technical names

| Concept                       | Admin Interface                     | Template        | API                               |
| ----------------------------- | ----------------------------------- | --------------- | --------------------------------- |
| Standard price                | "Price" field on the product        | `rawPrice`      | `price.price`                     |
| Currently valid price         | —                                   | `price`         | —                                 |
| List of promotional prices    | "Scheduled prices" tab              | —               | `price.scheduledPrices`           |
| Promotional price of an entry | "Price" column                      | —               | `scheduledPrices[].price`         |
| Period                        | "Start date" and "End date" columns | —               | `startDate` and `endDate`         |
| Promotion text                | Promotion text column               | `promotionInfo` | `scheduledPrices[].promotionInfo` |

## Further reading

* [\$wsProducts](/en/frontend/referenz/module/wsproducts#preis-eines-produkts) describes the price fields on the product object and `getFullPriceInfo()`.
* [\$wsBasket](/en/frontend/referenz/module/wsbasket) describes the fixed price of a cart item.
* [API reference Products](/en/schnittstellen/admin-interface-api/api-referenz-produkte#zeitgesteuerte-preise-aktionspreise) describes the format of the price fields and validation.
* [content - Catalog](/en/konfiguration/content-katalog-kategorien-produkte) describes the `price` data type and how to create additional price fields.


## Related topics

- [API reference products](/en/schnittstellen/admin-interface-api/api-referenz-produkte.md)
- [search - Sorting and filtering](/en/konfiguration/search-sortierung-und-filterung.md)
- [API reference categories](/en/schnittstellen/admin-interface-api/api-referenz-kategorien.md)
- [content - Catalogue (categories & products)](/en/konfiguration/content-katalog-kategorien-produkte.md)
- [$wsProducts - Product data](/en/frontend/referenz/module/wsproducts.md)
