mirror of
https://github.com/pretix/pretix.git
synced 2026-05-03 14:54:04 +00:00
Add itemvar_description, attendee_email and email to PDFvars
This commit is contained in:
@@ -87,6 +87,13 @@ DEFAULT_VARIABLES = OrderedDict((
|
||||
if orderposition.variation else str(orderposition.item.name)
|
||||
)
|
||||
}),
|
||||
("itemvar_description", {
|
||||
"label": _("Product variation description"),
|
||||
"editor_sample": _("Sample product variation description"),
|
||||
"evaluate": lambda orderposition, order, event: (
|
||||
str(orderposition.variation.description) if orderposition.variation else str(orderposition.item.description)
|
||||
)
|
||||
}),
|
||||
("item_category", {
|
||||
"label": _("Product category"),
|
||||
"editor_sample": _("Ticket category"),
|
||||
@@ -150,6 +157,11 @@ DEFAULT_VARIABLES = OrderedDict((
|
||||
str(getattr(op.addon_to.country, 'name', '')) if op.addon_to else ''
|
||||
)
|
||||
}),
|
||||
("attendee_email", {
|
||||
"label": _("Attendee email"),
|
||||
"editor_sample": 'foo@bar.com',
|
||||
"evaluate": lambda op, order, ev: op.attendee_email or (op.addon_to.attendee_email if op.addon_to else '')
|
||||
}),
|
||||
("event_name", {
|
||||
"label": _("Event name"),
|
||||
"editor_sample": _("Sample event name"),
|
||||
@@ -241,6 +253,11 @@ DEFAULT_VARIABLES = OrderedDict((
|
||||
"editor_sample": "+01 1234 567890",
|
||||
"evaluate": lambda op, order, ev: phone_format(order.phone)
|
||||
}),
|
||||
("email", {
|
||||
"label": _("Email"),
|
||||
"editor_sample": "foo@bar.com",
|
||||
"evaluate": lambda op, order, ev: order.email
|
||||
}),
|
||||
("invoice_name", {
|
||||
"label": _("Invoice address name"),
|
||||
"editor_sample": _("John Doe"),
|
||||
|
||||
Reference in New Issue
Block a user