diff --git a/src/pretix/static/pretixpresale/js/widget/widget.js b/src/pretix/static/pretixpresale/js/widget/widget.js index f8bafa6aa0..3ef0b42b7f 100644 --- a/src/pretix/static/pretixpresale/js/widget/widget.js +++ b/src/pretix/static/pretixpresale/js/widget/widget.js @@ -255,8 +255,9 @@ Vue.component('variation', { + '
' + '' + + ' :field_name="\'price_\' + item.id + \'_\' + variation.id" v-if="$root.showPrices">' + '' + + ' ' + '
' + '
' + '' @@ -299,10 +300,11 @@ Vue.component('item', { + '
' + '
' - + '' + '' - + '
{{ pricerange }}
' + + '
{{ pricerange }}
' + + ' ' + '
' + '
' + ''+ strings.variations + '' @@ -649,6 +651,23 @@ var shared_root_computed = { }, useIframe: function () { return Math.min(screen.width, window.innerWidth) >= 800 && (this.skip_ssl || site_is_secure()); + }, + showPrices: function () { + var has_priced = false; + var cnt_items = 0; + for (var i = 0; i < this.categories.length; i++) { + for (var j = 0; j < this.categories[i].items.length; j++) { + var item = this.categories[i].items[j]; + if (item.has_variations) { + cnt_items += item.variations.length; + has_priced = true; + } else { + cnt_items++; + has_priced = has_priced || item.price.gross != "0.00"; + } + } + } + return has_priced || cnt_items > 1; } };