# Automatic voucher

#### Automated discount for advertised customers

This configuration can be used optionally so that the customer automatically receives a discount in the shopping cart when using an affiliate link. This can be useful if the customer should also receive an incentive to make a purchase and benefit from the advertising.

If there are no products in the shopping cart when the affiliate link is clicked, the discount promotion will be applied automatically later, as soon as the first product is added. The reason for this is that Shopware does not allow promotions to be added to an empty shopping cart. This workaround therefore reliably enables the feature.

#### Promotion that is automatically applied to the advertised person

This is where the discount promotion is stored, which is then automatically added to the customer's shopping cart when affiliate links are used, provided that the automated discount for referred customers is activated.

It is important for the discount promotion to meet the following requirements:

* Must be active
* Must be within the valid period
* Must be assigned to the correct sales channel
* The promotion code type "Fixed promotion code" with a valid code (e.g., a random string of characters) must be selected

#### Show errors

This configuration can be used for debugging to obtain further information about why a discount promotion cannot be automatically applied to the shopping cart. We recommend disabling it in production mode.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.codegiganten.de/plugin-documentation/en/apps/affiliate-marketing/configuration/automatic-voucher.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
