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

# E-BP- (BestPrice order)

> The tags of the BestPrice order module: display group reservations, output the price tier reached and guide the buyer through the three steps of a reservation.

With the BestPrice order module, many buyers shop together. The shop advertises a campaign for a product, the buyers reserve quantities, and the more is reserved in total, the cheaper the unit price becomes for everyone. Only at the end of the campaign is an order created from it.

The tags with the prefix `E-BP_` show this in the template: the status of the campaign, the price tier reached, the buyer's own reservation and the savings.

Guide: BestPrice order module

> [!NOTE]
>
> The interface for the reservation process is located in the include template `incl_bestprice.htm`. Some of the tags only work there because they refer to the current process. The pure display tags can be used on all templates.

## The three steps of a reservation

The buyer goes through three steps. There is a range tag for each one, so all three steps can be in the same file.

| Tag | Step |
| - | - |
| `E-BP_Campaign` | Display product information and choose quantity |
| `E-BP_Summary` | Choose delivery address, confirm selected quantity, reserve button |
| `E-BP_Confirm` | Confirm reservation |

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{E-BP_Campaign}
   <!-- Schritt 1: Produkt und Mengenauswahl -->
{/E-BP_Campaign}

{E-BP_Summary}
   <!-- Schritt 2: Adresse und Zusammenfassung -->
{/E-BP_Summary}

{E-BP_Confirm}
   <!-- Schritt 3: Bestätigung -->
{/E-BP_Confirm}
```

## What the buyer needs

No reservation is possible without logging in and without stored addresses. Three range tags check this.

| Tag | Checks |
| - | - |
| `E-BP_Logged-In` | whether the buyer is logged in |
| `E-BP_Has-Address` | whether at least one billing address is stored in the customer account |
| `E-BP_Has-Delivery-Address` | whether at least one delivery address is stored in the customer account |

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{!E-BP_Logged-In}
   <p>Bitte melden Sie sich an, um an dieser Aktion teilzunehmen.</p>
{/!E-BP_Logged-In}

{E-BP_Logged-In}
   {!E-BP_Has-Address}
      <p>Bitte hinterlegen Sie zuerst eine Rechnungsadresse in Ihrem Kundenkonto.</p>
   {/!E-BP_Has-Address}
{/E-BP_Logged-In}
```

> [!WARNING]
>
> Check the login first and then the addresses. Without a login, there is no customer account in which addresses could be stored, and the two address checks are then meaningless.

## The status of the campaign

A campaign has a start and an end. Three range tags tell you where it currently stands.

| Tag | Applies when the campaign |
| - | - |
| `E-BP_Before-Begin` | has not started yet |
| `E-BP_Active` | is currently running |
| `E-BP_Finished` | has ended |

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{E-BP_Before-Begin}
   <p>Diese Aktion startet am ~E-BP_Begin~.</p>
{/E-BP_Before-Begin}

{E-BP_Active}
   <p>Noch bis ~E-BP_End~ können Sie mitbestellen.</p>
{/E-BP_Active}

{E-BP_Finished}
   <p>Diese Aktion ist beendet.</p>
{/E-BP_Finished}
```

`E-BP_Begin` and `E-BP_End` output the two points in time. Both accept an optional format in the parentheses.

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
~E-BP_Begin~                      <!-- Standardformat -->
~E-BP_Begin(%d.%m.%Y)~            <!-- nur das Datum -->
~E-BP_End(%d.%m.%Y um %H:%M)~
```

> [!NOTE]
>
> The format follows the usual notation with percent signs: `%d` for the day, `%m` for the month, `%Y` for the four-digit year, `%H` and `%M` for hour and minute. This option is not described in the previous documentation, but it is available in the module.

## The campaign and its product

| Tag | Returns |
| - | - |
| `E-BP_CampaignId` | the identifier of the campaign |
| `E-BP_Name` | the name of the product |
| `E-BP_ProdIndex` | the product index |
| `E-BP_ProdNumber` | the product number |
| `E-BP_Amount` | the quantity chosen by the buyer |
| `E-BP_TotalAmount` | the total quantity of all reservations for this campaign |

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
<h2>~E-BP_Name~</h2>
<p>Bisher reserviert: ~E-BP_TotalAmount~ Stück</p>

{E-BP_Amount}
   <p>Ihre Reservierung: ~E-BP_Amount~ Stück</p>
{/E-BP_Amount}
```

> [!NOTE]
>
> `E-BP_TotalAmount` is the key figure of the whole campaign: it adds up all buyers and thus determines the price tier reached. Display it prominently, because it is the reason why someone tells their friends about the campaign.

## The price tiers

Each campaign has a set of tiers consisting of minimum quantities and the corresponding unit prices. `E-BP_PriceList` is the loop over them.

| Tag | Returns |
| - | - |
| `E-BP_PriceList` | the loop over all price tiers |
| `E-BP_PriceList-Amount` | the minimum quantity of this tier |
| `E-BP_PriceList-Price` | the unit price of this tier, technical format |
| `E-BP_PriceList-Price_Format` | the same price in shop format |

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
<table>
   <tr><th>ab Menge</th><th>Stückpreis</th></tr>
   {@E-BP_PriceList}
      <tr>
         <td>~E-BP_PriceList-Amount~</td>
         <td>~E-BP_PriceList-Price_Format~</td>
      </tr>
   {/@E-BP_PriceList}
</table>
```

> [!WARNING]
>
> `E-BP_PriceList` is a pure loop tag. A simple enclosure `{E-BP_PriceList}` has no effect. You can tell whether there are any tiers at all by the fact that the loop does not run.

> [!NOTE]
>
> The three tags with `PriceList` in their name only output something inside the loop.

## Prices and savings

Every price exists twice: without a suffix in technical format and with the suffix `_Format` in shop format.

| without suffix | with `_Format` |
| - | - |
| period as decimal separator, no thousands separator, no currency symbol | the shop's price formatting |
| for calculations, form values and interfaces | for display to the buyer |

| Tag | Returns |
| - | - |
| `E-BP_BasicPrice` | the base price of the campaign, without any tiers |
| `E-BP_CurrentPrice` | the unit price currently reached |
| `E-BP_CurrentSaving` | the savings per piece compared to the base price |
| `E-BP_TotalPrice` | the price of the buyer's own reservation, unit price times quantity |
| `E-BP_TotalSaving` | the savings of the buyer's own reservation |
| `E-BP_CompletePrice` | the sum of all previous reservations of the buyer |
| `E-BP_CompleteSaving` | the sum of all savings of the buyer |
| `E-BP_NewCompletePrice` | the same sum including the current process |
| `E-BP_NewCompleteSaving` | the same total savings including the current process |

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{E-BP_CurrentPrice}
   <p>Aktueller Stückpreis: ~E-BP_CurrentPrice_Format~</p>
{/E-BP_CurrentPrice}

{E-BP_CurrentSaving}
   <p>Sie sparen ~E-BP_CurrentSaving_Format~ je Stück gegenüber ~E-BP_BasicPrice_Format~.</p>
{/E-BP_CurrentSaving}

{E-BP_TotalSaving}
   <p>Ihre Ersparnis bei dieser Reservierung: ~E-BP_TotalSaving_Format~</p>
{/E-BP_TotalSaving}
```

> [!NOTE]
>
> The current unit price is determined as follows: the shop goes through the tiers and takes the highest tier whose minimum quantity has already been reached by the total quantity of all buyers. If no tier is reached, the base price from `E-BP_BasicPrice` applies. The savings are the difference between the two.

> [!NOTE]
>
> The enclosure of these tags only applies for a value greater than zero. As long as no tier has been reached, there are no savings, and the negative range is the right place for a note that it is still worth recommending the campaign.

> [!WARNING]
>
> For `E-BP_CompletePrice`, the enclosure currently does not work in the module. Use the tag as a single tag and, if necessary, check via `E-BP_Orders` whether the buyer has any reservations at all.

> [!NOTE]
>
> `E-BP_NewCompletePrice` and `E-BP_NewCompleteSaving` are pure single tags. They belong in the second and third step of the reservation, where the buyer should see how much their total grows with this reservation.

## The buyer's reservations

`E-BP_Orders` lists all current reservations of the logged-in buyer, across campaigns.

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{E-BP_Orders}
   <table>
      {@E-BP_Orders}
         <tr>
            <td>~E-BP_Name~</td>
            <td>~E-BP_Amount~ Stück</td>
            <td>~E-BP_CurrentPrice_Format~</td>
            <td>~E-BP_TotalPrice_Format~</td>
            <td>~E-BP_OrderDate(%d.%m.%Y)~</td>
         </tr>
      {/@E-BP_Orders}
   </table>

   <p>Gesamt: ~E-BP_CompletePrice_Format~, davon gespart: ~E-BP_CompleteSaving_Format~</p>
{/E-BP_Orders}

{!E-BP_Orders}
   <p>Sie haben derzeit keine Reservierungen.</p>
{/!E-BP_Orders}
```

> [!NOTE]
>
> Inside the loop, all campaign and price tags refer to the respective reservation. Outside it, they refer to the campaign currently being displayed. The same tags therefore stand for both, depending on where they are placed.

`E-BP_OrderDate` outputs the time of the reservation and, like `E-BP_Begin`, accepts an optional format.

## The addresses of the reservation

Two ranges switch to the billing or delivery address of the reservation. Within them, `E-BP_Address-…` outputs the individual fields.

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{E-BP_BillingAddress}
   ~E-BP_Address-Company~<br>
   ~E-BP_Address-FirstName~ ~E-BP_Address-LastName~<br>
   ~E-BP_Address-Street1~<br>
   ~E-BP_Address-Zip~ ~E-BP_Address-City~
{/E-BP_BillingAddress}

{E-BP_DeliveryAddress}
   ~E-BP_Address-FirstName~ ~E-BP_Address-LastName~<br>
   ~E-BP_Address-Street1~<br>
   ~E-BP_Address-Zip~ ~E-BP_Address-City~
{/E-BP_DeliveryAddress}
```

Supported field names:

`Company`, `Salutation`, `SalutationCode`, `Title`, `TitleCode`, `FirstName`, `LastName`, `Street1`, `Street2`, `Zip`, `City`, `State`, `Country`, `CountryISO`, `PostOfficeBox`, `PostCenter`, `Department`, `Phone`, `BusinessPhone`, `MobilePhone`, `Fax`, `BusinessFax`, `E-Mail`, `DateOfBirth`, `TaxId` and `Suffix1` to `Suffix10`.

> [!WARNING]
>
> `E-BP_Address-…` only outputs something inside one of the two address ranges. Outside them, there is no defined address it could refer to.

> [!NOTE]
>
> The two address ranges cannot be used as negative ranges. Check beforehand with `E-BP_Has-Address` or `E-BP_Has-Delivery-Address` whether an address exists.

## Messages

| Tag | Returns |
| - | - |
| `E-BP_Error` | an error message |
| `E-BP_Info` | a success message |

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{E-BP_Error}
   <p class="fehler">~E-BP_Error~</p>
{/E-BP_Error}

{E-BP_Info}
   <p class="hinweis">~E-BP_Info~</p>
{/E-BP_Info}
```

## Checking permissions

`E-BP_Warranty()` encloses content based on the buyer's permissions. The parentheses contain a comma-separated list of identifiers; the range appears as soon as one of them applies.

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{E-BP_Warranty(haendler,grosskunde)}
   <p>Für Sie gelten die Händlerkonditionen dieser Aktion.</p>
{/E-BP_Warranty(haendler,grosskunde)}
```

> [!WARNING]
>
> This tag is not described in the previous documentation, but it is available in the module. Which identifiers are assigned in your shop depends on the permissions configuration. Check the result before you build on it.

## The reservation form

The form with which the buyer makes a reservation must submit the process identifier. It is in `E-BP_OrderId`.

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
<form action="~FORM-Template(ws_product.htm)~" method="post">
   <input type="hidden" name="orderid" value="~E-BP_OrderId~">
   <!-- Mengenauswahl und Reservieren-Schaltfläche -->
</form>
```

> [!WARNING]
>
> Without this hidden parameter, the shop cannot tell two submissions of the same form apart. An accidental double click then leads to two reservations. Conversely, the identifier allows you to deliberately reserve the same product several times in the same quantity.

## The tags at a glance

| Tag | Single tag | Range tag | Negative range tag | Loop tag |
| - | - | - | - | - |
| `E-BP_Error` | yes | yes | yes | – |
| `E-BP_Info` | yes | yes | yes | – |
| `E-BP_Campaign` | – | yes | yes | – |
| `E-BP_Summary` | – | yes | yes | – |
| `E-BP_Confirm` | – | yes | yes | – |
| `E-BP_Logged-In` | – | yes | yes | – |
| `E-BP_Has-Address` | – | yes | yes | – |
| `E-BP_Has-Delivery-Address` | – | yes | yes | – |
| `E-BP_Before-Begin` | – | yes | yes | – |
| `E-BP_Active` | – | yes | yes | – |
| `E-BP_Finished` | – | yes | yes | – |
| `E-BP_Begin()` | yes | – | – | – |
| `E-BP_End()` | yes | – | – | – |
| `E-BP_CampaignId` | yes | – | – | – |
| `E-BP_Name` | yes | – | – | – |
| `E-BP_ProdIndex` | yes | – | – | – |
| `E-BP_ProdNumber` | yes | – | – | – |
| `E-BP_Amount` | yes | yes | yes | – |
| `E-BP_TotalAmount` | yes | – | – | – |
| `E-BP_PriceList` | – | – | – | yes |
| `E-BP_PriceList-Amount` | yes | – | – | – |
| `E-BP_PriceList-Price` | yes | – | – | – |
| `E-BP_PriceList-Price_Format` | yes | – | – | – |
| `E-BP_BasicPrice` | yes | yes | yes | – |
| `E-BP_BasicPrice_Format` | yes | – | – | – |
| `E-BP_CurrentPrice` | yes | yes | yes | – |
| `E-BP_CurrentPrice_Format` | yes | – | – | – |
| `E-BP_CurrentSaving` | yes | yes | yes | – |
| `E-BP_CurrentSaving_Format` | yes | – | – | – |
| `E-BP_TotalPrice` | yes | yes | yes | – |
| `E-BP_TotalPrice_Format` | yes | – | – | – |
| `E-BP_TotalSaving` | yes | yes | yes | – |
| `E-BP_TotalSaving_Format` | yes | – | – | – |
| `E-BP_CompletePrice` | yes | – | – | – |
| `E-BP_CompletePrice_Format` | yes | – | – | – |
| `E-BP_CompleteSaving` | yes | yes | yes | – |
| `E-BP_CompleteSaving_Format` | yes | – | – | – |
| `E-BP_NewCompletePrice` | yes | – | – | – |
| `E-BP_NewCompletePrice_Format` | yes | – | – | – |
| `E-BP_NewCompleteSaving` | yes | – | – | – |
| `E-BP_NewCompleteSaving_Format` | yes | – | – | – |
| `E-BP_Orders` | – | yes | yes | yes |
| `E-BP_OrderDate()` | yes | – | – | – |
| `E-BP_OrderId` | yes | – | – | – |
| `E-BP_BillingAddress` | – | yes | – | – |
| `E-BP_DeliveryAddress` | – | yes | – | – |
| `E-BP_Address-…` | yes | – | – | – |
| `E-BP_Warranty()` | – | yes | yes | – |

| Tag | Permitted in templates |
| - | - |
| `E-BP_Campaign`, `E-BP_Summary`, `E-BP_Confirm`, `E-BP_Logged-In`, `E-BP_Has-Address`, `E-BP_Has-Delivery-Address`, `E-BP_Active`, `E-BP_Before-Begin`, `E-BP_Finished`, `E-BP_NewCompletePrice`, `E-BP_NewCompleteSaving` | `incl_bestprice.htm` |
| all others | all |

## Related topics

* Guide: BestPrice order module
* Guide: Login and registration
* Guide: Address data


## Related topics

- [Materials: BestPrice order module](https://dokumentation.websale.de/en/v8s/materialien/materialien-bestprice-order-modul.md)
- [Prices, taxes, and currency](https://dokumentation.websale.de/en/v8s/referenz/konfigurationen/shopkonfiguration-shop-config/preise-steuern-und-waehrung.md)
- [Emails](https://dokumentation.websale.de/en/v8s/referenz/konfigurationen/shopkonfiguration-shop-config/e-mails.md)
- [content - Catalogue (categories & products)](https://dokumentation.websale.de/en/konfiguration/content-katalog-kategorien-produkte.md)
- [Price formatting](https://dokumentation.websale.de/en/v8s/preise/preisformatierungen.md)


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