mirror of
https://github.com/pretix/pretix.git
synced 2026-05-08 15:44:02 +00:00
Widget: Do not disable products with require_voucher if a voucher is
given
This commit is contained in:
@@ -186,22 +186,22 @@ var widget_id = makeid(16);
|
|||||||
/* Vue Components */
|
/* Vue Components */
|
||||||
Vue.component('availbox', {
|
Vue.component('availbox', {
|
||||||
template: ('<div class="pretix-widget-availability-box">'
|
template: ('<div class="pretix-widget-availability-box">'
|
||||||
+ '<div class="pretix-widget-availability-unavailable" v-if="item.require_voucher">'
|
+ '<div class="pretix-widget-availability-unavailable" v-if="require_voucher">'
|
||||||
+ '<small>' + strings.voucher_required + '</small>'
|
+ '<small>' + strings.voucher_required + '</small>'
|
||||||
+ '</div>'
|
+ '</div>'
|
||||||
+ '<div class="pretix-widget-availability-unavailable"'
|
+ '<div class="pretix-widget-availability-unavailable"'
|
||||||
+ ' v-if="!item.require_voucher && avail[0] < 100 && avail[0] > 10">'
|
+ ' v-if="!require_voucher && avail[0] < 100 && avail[0] > 10">'
|
||||||
+ strings.reserved
|
+ strings.reserved
|
||||||
+ '</div>'
|
+ '</div>'
|
||||||
+ '<div class="pretix-widget-availability-gone" '
|
+ '<div class="pretix-widget-availability-gone" '
|
||||||
+ ' v-if="!item.require_voucher && avail[0] <= 10">'
|
+ ' v-if="!require_voucher && avail[0] <= 10">'
|
||||||
+ strings.sold_out
|
+ strings.sold_out
|
||||||
+ '</div>'
|
+ '</div>'
|
||||||
+ '<div class="pretix-widget-waiting-list-link"'
|
+ '<div class="pretix-widget-waiting-list-link"'
|
||||||
+ ' v-if="waiting_list_show">'
|
+ ' v-if="waiting_list_show">'
|
||||||
+ '<a :href="waiting_list_url" target="_blank" @click="$root.open_link_in_frame">' + strings.waiting_list + '</a>'
|
+ '<a :href="waiting_list_url" target="_blank" @click="$root.open_link_in_frame">' + strings.waiting_list + '</a>'
|
||||||
+ '</div>'
|
+ '</div>'
|
||||||
+ '<div class="pretix-widget-availability-available" v-if="!item.require_voucher && avail[0] === 100">'
|
+ '<div class="pretix-widget-availability-available" v-if="!require_voucher && avail[0] === 100">'
|
||||||
+ '<label class="pretix-widget-item-count-single-label" v-if="order_max === 1">'
|
+ '<label class="pretix-widget-item-count-single-label" v-if="order_max === 1">'
|
||||||
+ '<input type="checkbox" value="1" :checked="!!amount_selected" @change="amount_selected = $event.target.checked" :name="input_name">'
|
+ '<input type="checkbox" value="1" :checked="!!amount_selected" @change="amount_selected = $event.target.checked" :name="input_name">'
|
||||||
+ '</label>'
|
+ '</label>'
|
||||||
@@ -224,6 +224,9 @@ Vue.component('availbox', {
|
|||||||
this.$root.$emit('amounts_changed')
|
this.$root.$emit('amounts_changed')
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
require_voucher: function () {
|
||||||
|
return this.item.require_voucher && !this.$root.voucher_code
|
||||||
|
},
|
||||||
amount_selected: {
|
amount_selected: {
|
||||||
get: function () {
|
get: function () {
|
||||||
return this.item.has_variations ? this.variation.amount_selected : this.item.amount_selected
|
return this.item.has_variations ? this.variation.amount_selected : this.item.amount_selected
|
||||||
|
|||||||
Reference in New Issue
Block a user