From 118f0f55e908631c396541ebb3bd7c4d74c33e39 Mon Sep 17 00:00:00 2001 From: Raphael Michel Date: Mon, 24 Aug 2020 17:31:57 +0200 Subject: [PATCH] Widget: Do not disable products with require_voucher if a voucher is given --- src/pretix/static/pretixpresale/js/widget/widget.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/pretix/static/pretixpresale/js/widget/widget.js b/src/pretix/static/pretixpresale/js/widget/widget.js index 1e1d5280b..399f67bee 100644 --- a/src/pretix/static/pretixpresale/js/widget/widget.js +++ b/src/pretix/static/pretixpresale/js/widget/widget.js @@ -186,22 +186,22 @@ var widget_id = makeid(16); /* Vue Components */ Vue.component('availbox', { template: ('
' - + '
' + + '
' + '' + strings.voucher_required + '' + '
' + '
' + + ' v-if="!require_voucher && avail[0] < 100 && avail[0] > 10">' + strings.reserved + '
' + '
' + + ' v-if="!require_voucher && avail[0] <= 10">' + strings.sold_out + '
' + '' - + '
' + + '
' + '' @@ -224,6 +224,9 @@ Vue.component('availbox', { this.$root.$emit('amounts_changed') }, computed: { + require_voucher: function () { + return this.item.require_voucher && !this.$root.voucher_code + }, amount_selected: { get: function () { return this.item.has_variations ? this.variation.amount_selected : this.item.amount_selected