Party Small Ticket
We separated the PDF and Screen template parts. The first part is for the ticket. The second part (else-statement) contains the default template.
No padding: checked
Width: 210
Height: 90
QR code size: 50
{% apply spaceless %}{% autoescape false %}
{%- if forPDFOutput -%}
{{ PRODUCT.get_name|escape }}
{%- if not OPTIONS.wcTicketHideDateOnPDF and TICKET.start_date is not empty -%}
{{ TICKET.start_date_timestamp|date("l")|upper }}
{{ TICKET.start_date_timestamp|date("M jS")|upper }}
{{ TICKET.start_date_timestamp|date("Y")|upper }}
{%- endif -%}
{%- if OPTIONS.wcTicketDisplayShortDesc -%}
{%- if OPTIONS.wcTicketPDFStripHTML == 3 -%}
{{- TICKET.short_desc|escape -}}
{% endif %}
{%- if OPTIONS.wcTicketPDFStripHTML == 2 -%}
{{- TICKET.short_desc|escape('wp_filter_nohtml_kses') -}}
{%- else -%}
{{- TICKET.short_desc|escape('wp_kses_post')|raw|nl2br -}}
{% endif %}
{% endif %}
{%- if not OPTIONS.wcTicketDontDisplayPrice -%}
{{ wc_price(ORDER_ITEM.get_subtotal + ORDER_ITEM.get_subtotal_tax) }}
{% endif %}
{%- if TICKET.location is not empty -%}
{{ TICKET.location|escape('wp_kses_post') }}
{%- endif -%}
{{ TICKET.public_ticket_number }}
{%- if TICKET.info is not empty -%}
{%- if OPTIONS.wcTicketPDFStripHTML == 3 -%}
{{- TICKET.info|escape -}}
{% endif %}
{%- if OPTIONS.wcTicketPDFStripHTML == 2 -%}
{{- TICKET.info|escape('wp_filter_nohtml_kses') -}}
{%- else -%}
{{- TICKET.info|escape('wp_kses_post')|raw|nl2br -}}
{%- endif -%}
{%- endif -%}
{QRCODE_INLINE}
{% else %}
{{ OPTIONS.wcTicketHeading|escape('wp_kses_post')|raw }}
{{ PRODUCT.get_name|escape }}
{%- if OPTIONS.wcTicketPDFDisplayVariantName and PRODUCT.get_attributes|length > 0 -%}
{%- for item in PRODUCT.get_attributes -%}
{{- item|striptags -}}
{%- endfor -%}
{%- endif -%}
{%- if not OPTIONS.wcTicketHideDateOnPDF and TICKET.start_date is not empty -%}
{{- TICKET.date_as_string -}}
{%- if TICKET.end_date is not empty and date(TICKET.end_date_timestamp) < date() -%}
{{ OPTIONS.wcTicketTransExpired }}
{%- endif -%}
{%- if TICKET.location is not empty -%}
{{ OPTIONS.wcTicketTransLocation }} {{ TICKET.location|escape('wp_kses_post') }}
{%- endif -%}
{%- else -%}
{%- if TICKET.location is not empty -%}
{{ OPTIONS.wcTicketTransLocation }} {{ TICKET.location|escape('wp_kses_post') }}
{%- endif -%}
{%- endif -%}
{%- if OPTIONS.wcTicketDisplayShortDesc -%}
{%- if OPTIONS.wcTicketPDFStripHTML == 3 -%}
{{- TICKET.short_desc|escape -}}
{% endif %}
{%- if OPTIONS.wcTicketPDFStripHTML == 2 -%}
{{- TICKET.short_desc|escape('wp_filter_nohtml_kses') -}}
{%- else -%}
{{- TICKET.short_desc|escape('wp_kses_post') -}}
{% endif %}
{% endif %}
{%- if TICKET.info is not empty -%}
{%- if OPTIONS.wcTicketPDFStripHTML == 3 -%}
{{- TICKET.info|escape -}}
{% endif %}
{%- if OPTIONS.wcTicketPDFStripHTML == 2 -%}
{{- TICKET.info|escape('wp_filter_nohtml_kses') -}}
{%- else -%}
{{- TICKET.info|escape('wp_kses_post') -}}
{%- endif -%}
{%- endif -%}
{%- if not OPTIONS.wcTicketDontDisplayCustomer -%}
{{ OPTIONS.wcTicketTransCustomer|escape('wp_kses_post') }}
{{ ORDER.get_formatted_billing_address|trim|escape('wp_kses_post') }}
{% endif %}
{%- if not OPTIONS.wcTicketDontDisplayPayment -%}
{{ OPTIONS.wcTicketTransPaymentDetail|escape('wp_kses_post') }}
{{ OPTIONS.wcTicketTransPaymentDetailPaidAt|escape('wp_kses_post') }} {{ TICKET.order_date_paid_text|escape }}
{{ OPTIONS.wcTicketTransPaymentDetailCompletedAt|escape('wp_kses_post') }} {{ TICKET.order_date_completed_text|escape }}
{%- if ORDER.get_payment_method_title is empty %}
{{ OPTIONS.wcTicketTransPaymentDetailFreeTicket|escape('wp_kses_post') }}
{% else %}
{{ OPTIONS.wcTicketTransPaymentDetailPaidVia|escape('wp_kses_post') }} {{ ORDER.get_payment_method_title|escape }} (#{{ ORDER.get_transaction_id|escape }})
{% endif %}
{%- if ORDER.get_coupon_codes -%}
{{ OPTIONS.wcTicketTransPaymentDetailCouponUsed|escape('wp_kses_post') }} {{ ORDER.get_coupon_codes|join(", ") }}
{% endif %}
{% endif %}
{%- if METAOBJ.user.value is not empty and OPTIONS.wcTicketDisplayTicketUserValue -%}
{{ OPTIONS.wcTicketTransDisplayTicketUserValue|escape('wp_kses_post') }} {{ METAOBJ.user.value|escape }}
{%- endif -%}
{%- if METAOBJ.wc_ticket.name_per_ticket is not empty -%}
{{ TICKET.name_per_ticket_label ~ " " ~ METAOBJ.wc_ticket.name_per_ticket }}
{%- endif -%}
{%- if METAOBJ.wc_ticket.value_per_ticket is not empty -%}
{{ TICKET.value_per_ticket_label ~ " " ~ METAOBJ.wc_ticket.value_per_ticket }}
{%- endif -%}
{%- if OPTIONS.wcTicketDisplayPurchasedItemFromOrderOnTicket and ORDER.get_items|length > 1 %}
Additional order items
{% for item_id, item in ORDER.get_items %}
{%- if item_id != METAOBJ.woocommerce.item_id -%}
{{ item.get_quantity }}x {{ item.get_name|escape }}
{%- endif -%}
{% endfor %}
{%- endif -%}
{%- if OPTIONS.wcTicketDisplayCustomerNote and ORDER.get_customer_note is not empty -%}
"{{ ORDER.get_customer_note|escape }}"
{% endif %}
{%- if OPTIONS.wcTicketDisplayPurchasedTicketQuantity -%}
{% if forPDFOutput %}
{% endif %}
{{ OPTIONS.wcTicketPrefixTextTicketQuantity|escape('wp_kses_post')|replace({'{TICKET_POSITION}': TICKET.order_item_pos, '{TICKET_TOTAL_AMOUNT}': TICKET.codes|length}) }}
{% endif %}
{%- if TICKET.text_redeem_amount is not empty -%}
{{ TICKET.text_redeem_amount }}
{% endif %}
{{ OPTIONS.wcTicketTransTicket|escape('wp_kses_post') }} {{ CODEOBJ.code_display }}
{%- if not OPTIONS.wcTicketDontDisplayPrice -%}
{{ OPTIONS.wcTicketTransPrice|escape('wp_kses_post') }}
{{ wc_price(ORDER_ITEM.get_subtotal + ORDER_ITEM.get_subtotal_tax) }}
{% if PRODUCT.get_price != ORDER_ITEM.get_subtotal %}
{{ OPTIONS.wcTicketTransProductPrice|escape('wp_kses_post') }} {{ wc_price(PRODUCT.get_price) }}
{% endif %}
{% endif %}
{%- if OPTIONS.wcTicketDisplayTicketListName -%}
{{ LISTOBJ.name|escape('wp_kses_post')|raw|nl2br }}
{% endif %}
{%- if OPTIONS.wcTicketDisplayTicketListDesc -%}
{%- if OPTIONS.wcTicketDisplayTicketListName -%}
{% endif %}{{ LIST_METAOBJ.desc|escape('wp_kses_post')|raw|nl2br }}
{% endif %}
{%- if not isScanner -%}
{% endif %}
{{ TICKET.public_ticket_number }}
{%- endif -%}
{% endautoescape %}{% endapply %}