From 5702f51973448b0c6261b7902ecf2f0da857d646 Mon Sep 17 00:00:00 2001 From: Richard Schreiber Date: Thu, 27 Aug 2026 16:43:36 +0200 Subject: [PATCH] Widget: fix show taxline for 0 or 0.00 tax-rate --- src/pretix/static/pretixpresale/js/widget/widget.js | 6 +++++- .../static/pretixpresale/widget/src/components/PriceBox.vue | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/pretix/static/pretixpresale/js/widget/widget.js b/src/pretix/static/pretixpresale/js/widget/widget.js index 9c25ba3a32..fd4f3338b2 100644 --- a/src/pretix/static/pretixpresale/js/widget/widget.js +++ b/src/pretix/static/pretixpresale/js/widget/widget.js @@ -345,7 +345,7 @@ Vue.component('pricebox', { + ' :min="display_price_nonlocalized" :value="suggested_price_nonlocalized" :name="field_name"' + ' step="any" v-bind:aria-labelledby="aria_labelledby" v-bind:aria-describedby="price_desc_id">' + '' - + '' + + '' + '{{ taxline }}' + '' + ''), @@ -422,6 +422,10 @@ Vue.component('pricebox', { return '' + this.$root.currency + " " + this.display_price; } }, + show_taxline: function () { + // rate can either be "0.00" or "0" => parseFloat to check + return Number.parseFloat(this.price.rate) && Number.parseFloat(this.price.gross); + }, taxline: function () { if (this.$root.display_net_prices) { if (this.price.includes_mixed_tax_rate) { diff --git a/src/pretix/static/pretixpresale/widget/src/components/PriceBox.vue b/src/pretix/static/pretixpresale/widget/src/components/PriceBox.vue index 4b0d78b017..ef2733960d 100644 --- a/src/pretix/static/pretixpresale/widget/src/components/PriceBox.vue +++ b/src/pretix/static/pretixpresale/widget/src/components/PriceBox.vue @@ -86,7 +86,8 @@ const taxline = computed(() => { } }) -const showTaxline = computed(() => props.price.rate !== '0' && props.price.gross !== '0.00') +// rate can either be "0.00" or "0" => parseFloat to check +const showTaxline = computed(() => Number.parseFloat(props.price.rate) && Number.parseFloat(props.price.gross))