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

# Offering download products

> How to sell paid download products in WEBSALE V8s, secure the download, and restrict payment and shipping methods accordingly.

A download product consists of a file that the buyer downloads after the purchase, normally immediately after submitting the order. Otherwise it behaves like any other product: it has images, a description, variants, a price, and a VAT rate, and is placed in the shopping cart quite normally.

All file types are supported, for example GIF, JPG, PDF, ZIP, or EXE. If multiple files are to be sold as one product, pack them into an archive, for example as a ZIP.

## How the download is secured

A download link is worthless without protection, because it can be forwarded and published. WEBSALE V8s therefore secures it on three levels.

### Download ID

If an order contains download products, it receives a download ID in addition to the order number. It is unique per order like the order number, consists of a digital signature, and is therefore tamper-proof.

### Signed link without a file name

The download link itself is also digitally signed and thereby protected against tampering. The name of the download file is not part of the link, and therefore cannot be derived from it.

### Limited number and validity period

You limit both per product. This way, a forwarded link remains usable only to a limited extent.

| Setting | Default |
| - | - |
| Number of possible downloads | 10 |
| Validity period, in hours or days | 2 days |

> [!NOTE]
>
> Do not set the number to 1. A download can fail due to a connection drop or an operating error, and it is technically not possible to prove an error-free download. The buyer would then be left with nothing.

## Process from the buyer's perspective

After the purchase, the download link already appears on the confirmation page. It is additionally included in the confirmation email.

If the buyer has registered in the shop, the purchase is also stored in their download account for three years. There they will find all downloads purchased in the shop, including those already completed and thereby deactivated.

If a download has not succeeded despite multiple attempts, you can subsequently grant further downloads or extend the validity in the online service area.

## Requirements

The download module is activated for your shop by WEBSALE AG.

The storage space for the download directory on the server is 10 GB in total. The files must be stored locally in the directory `produkte/download`.

> [!WARNING]
>
> The download directory is not cleaned up automatically. Files that are no longer used in the shop remain in place and continue to count against the 10 GB. For cleanup, WEBSALE AG will set up an SFTP access to the directory for you on request.

## Creating download products

You create the products in the WSPManager or transfer them from an ERP system. You upload the associated files via WSPManager or via FTP.

> [!NOTE]
>
> When uploading via the WSPManager, file size limits apply. Large files should therefore be uploaded via FTP. Your WEBSALE representative will tell you the exact limits.

For each download product, you set:

* the name of the download file, which the WSPManager automatically transfers to the server
* the number of possible downloads
* the validity period in hours or days
* the "free shipping" flag

The "free shipping" flag is more than a price indication. In the next step it also controls which shipping methods the shop offers at all.

## Adding to the shop configuration

Create the `<Download>` section in the `shop.config`. It contains the labels under which the download ID and the download link appear in the shop.

```ini theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
<Download>
   ID-Txt      = Download-ID
   Link-Txt    = Zum Download
</Download>
```

Reference: Section Download&#x20;

## Restricting payment methods

Buyers usually want a download right away. With payment by invoice, the goods would be delivered before the money arrives. You can therefore exclude individual payment methods as soon as download products are in the shopping cart, and thereby restrict payment to online clearing procedures.

To do this, set the `DenyForDownload` parameter in the `shop.config` in the respective `<PaymentXXX-Txt>` section.

```ini theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
<PaymentBill-Txt>
   Allow             = yes
   Name              = Rechnung
   ...
   DenyForDownload   = yes
</PaymentBill-Txt>
```

> [!NOTE]
>
> The block takes effect as soon as at least one download product is in the shopping cart. A mixed order of download and shippable products therefore also falls under it.

## Restricting shipping methods

If the buyer orders exclusively download products, selecting a normal shipping method makes no sense. Conversely, a shipping method called "Download" does not fit an order with shippable goods.

Two parameters in the `<+Deliverer>` sections show or hide a shipping method depending on whether the order is free of shipping costs overall.

| Parameter | Effect when `yes` |
| - | - |
| `HideForFreeDelivery` | hide the shipping method when the order is entirely free of shipping costs |
| `HideForNoFreeDelivery` | hide the shipping method when the order is not entirely free of shipping costs |

```ini theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
<+Deliverer>
   Allow                   = yes # [yes|no], standard = no
   Name-Txt                = DHL
   Country-Txt             = innerhalb Deutschlands
   HideForFreeDelivery     = yes
   ...
</+Deliverer>

<+Deliverer>
   Allow                   = yes # [yes|no], standard = no
   Name-Txt                = Download (kein Versand, versandkostenfrei)
   Country-Txt             =
   HideForNoFreeDelivery   = yes
   ...
</+Deliverer>
```

If these were the only two shipping methods, the result would be:

| Contents of the order | Offered shipping method |
| - | - |
| only shipping-free products | Download (kein Versand, versandkostenfrei) |
| shipping-charged and shipping-free products | DHL, innerhalb Deutschlands |

Reference: Section +Deliverer&#x20;

## Template of the download module

The download module comes with its own template that you visually adapt to your shop. Enter it in the `shop.config` in the `<Templates>` section after the `Download` parameter.

```ini theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
<Templates>
   ...
   Download    = ws_download.htm
   ...
</Templates>
```

Dedicated tags are available on this template.

## Setting links to the downloads

Two tags lead to the downloads. They differ in whether they point to a single order or to the permanent account.

### Link to the purchase, WS-OrderDownloadLink

Belongs on the confirmation template and leads to the downloads of the order just completed. Used as a bracket, the area only appears when at least one download product has actually been purchased.

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{WS-OrderDownloadLink}
   <a href="~WS-OrderDownloadLink~">Ihre Downloads</a>
{/WS-OrderDownloadLink}
```

### Link to the download account, WS-UserDownloadLink

Belongs on any template and leads to the buyer's permanent download account. Since this account only exists for registered buyers, the link belongs inside an `ST-LoggedIn` bracket.

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{ST-LoggedIn}
   <a href="~WS-UserDownloadLink~">Ihre Downloads</a>
{/ST-LoggedIn}
```


## Related topics

- [Download template: tags](https://dokumentation.websale.de/en/v8s/referenz/tags/download-template-tags.md)
- [Purchase vouchers for printing](https://dokumentation.websale.de/en/v8s/gutscheine-anbieten/kaufgutscheine-zum-ausdrucken.md)
- [Practical examples - Vouchers](https://dokumentation.websale.de/en/frontend/praxisbeispiele/gutscheine.md)
- [Enabling and disabling shop test modes](https://dokumentation.websale.de/en/v8s/domains/testmodi-des-shops-ein-ausschalten.md)
- [Adding products via voucher](https://dokumentation.websale.de/en/v8s/gutscheine-anbieten/produkte-mittels-gutschein-zusteuern.md)


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