From 4207b2c0fb686e02c88d2621a41fe9344b685eae Mon Sep 17 00:00:00 2001 From: Richard Schreiber Date: Thu, 22 Sep 2022 21:55:24 +0200 Subject: [PATCH] Improve voucher redeem if no products are available (#2813) --- .../templates/pretixpresale/event/voucher.html | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/pretix/presale/templates/pretixpresale/event/voucher.html b/src/pretix/presale/templates/pretixpresale/event/voucher.html index a81843ac3..b2d8a3c56 100644 --- a/src/pretix/presale/templates/pretixpresale/event/voucher.html +++ b/src/pretix/presale/templates/pretixpresale/event/voucher.html @@ -73,9 +73,21 @@ {% endif %}

+ {% if options == 0 %} + {% if request.event.has_subevents and not voucher.subevent %} + {% blocktrans trimmed %} + For the selected date, there are currently no products available that can be bought with this voucher. Please try a different date or a different voucher. + {% endblocktrans %} + {% else %} + {% blocktrans trimmed %} + There are currently no products available that can be bought with this voucher. + {% endblocktrans %} + {% endif %} + {% else %} {% blocktrans trimmed %} You entered a voucher code that allows you to buy one of the following products at the specified price: {% endblocktrans %} + {% endif %}

{% if event.presale_is_running or event.settings.show_items_outside_presale_period %}
{% endfor %} {% eventsignal event "pretix.presale.signals.voucher_redeem_info" voucher=voucher %} - {% if event.presale_is_running %} + {% if event.presale_is_running and options > 0 %}