> For the complete documentation index, see [llms.txt](https://docs.codegiganten.de/plugin-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.codegiganten.de/plugin-documentation/en/apps/affiliate-marketing/configuration/automatic-voucher.md).

# 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
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
