From 7e62cddb973d1a561f858afcd71b515ab04f084b Mon Sep 17 00:00:00 2001 From: Raphael Michel Date: Mon, 22 Jan 2018 22:49:51 +0100 Subject: [PATCH] PDF ticket output: Add item category variable --- src/pretix/plugins/ticketoutputpdf/ticketoutput.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/pretix/plugins/ticketoutputpdf/ticketoutput.py b/src/pretix/plugins/ticketoutputpdf/ticketoutput.py index c25b76a39b..5a8c85178b 100644 --- a/src/pretix/plugins/ticketoutputpdf/ticketoutput.py +++ b/src/pretix/plugins/ticketoutputpdf/ticketoutput.py @@ -69,6 +69,13 @@ DEFAULT_VARIABLES = OrderedDict(( "editor_sample": _("Sample product description"), "evaluate": lambda orderposition, order, event: str(orderposition.item.description) }), + ("item_category", { + "label": _("Product category"), + "editor_sample": _("Ticket category"), + "evaluate": lambda orderposition, order, event: ( + str(orderposition.item.category.name) if orderposition.item.category else "" + ) + }), ("price", { "label": _("Price"), "editor_sample": _("123.45 EUR"),