I’ve just copied the code from the legacy to the new app - and the customer email and order number are missing completely.
Is there anything I need to be adding to the code to pull these through again?
see below code for email:
{% if customer.email != blank %}
- {{ customer.email }}
{% endif %}
and then order number:
.printer-preview-content .t118122 .order-number-barcode,
.printer-preview-content .t118122 .product-barcode {
display: block;
also if anyone has any obvious suggestions, please let me know as I’ve not had much experience with this app
MakP
May 28, 2024, 1:05pm
2
For the order number, make sure you have changed “{{ order_name }}” to “{{ order.name }}” - Slight difference, but the second works and the first does not.
On the email: Your code is actually working fine when I test it. This may sound silly, but I would just double check that the order you’re testing this on actually contains a customer email (I only mention this because your screenshot looks like a test order and it could be possible there is no email for that particular order number). If you’re sure your order contains an email, you could try changing your code to include the “order.” prefix, which should result in the same thing:
{% if order.customer.email != blank %}
- {{ order.customer.email }}
{% endif %}
Many Thanks @MakP that has worked…
However I now cannot get the order notes to print. On the old app, any notes put on in the cart, pulled through to the order printout, for the pickers to view. I have tried changing to order.notes but still not working. Probably an easy fix as above - have you got any suggestions?
{% assign primary_font = "Roboto"%}
{% assign primary_font_color = "#000000" %}
{% assign primary_font_size = "11px"%}
{% assign secondary_font = "Roboto"%}
{% assign secondary_font_color = "#333333" %}
{% assign theme_color = "#000000"%}
Campus&Co Dunstable
campusandcodunstable.com
Bill to
{% assign billing_address = billing_address | default: customer.default_address %}
{% if billing_address and billing_address != blank %}
- {{ billing_address.name }}
{% if billing_address.company != blank %}
- {{ billing_address.company }}
{% endif %}
- {{ billing_address.address1 }}
{% if billing_address.address2 != blank %}
- {{ billing_address.address2 }}
{% endif %}
- {{ billing_address.city }}
{% if billing_address.province_code != '' %}
{{ billing_address.province_code | replace: "ENG", "" }}
{% else %}
{{ billing_address.province | default: "England" }}
{% endif %}
- {{ billing_address.zip | upcase }}
{% if shop.country != billing_address.country %}
- {{ billing_address.country }}
{% endif %}
- Tel. {{ billing_address.phone | default: customer.phone }}
{% elsif customer != blank %}
{% if customer.name != blank %}
- {{ customer.name }}
{% endif %}
{% if order.customer.email != blank %}
- {{ order.customer.email }}
{% endif %}
{% if customer.phone != blank %}
- Tel. {{ customer.phone }}
{% endif %}
{% endif %}
{% if shipping_address and shipping_address != "" and shipping_address != nil %}
Deliver to
{% endif %}
{% if shipping_address and shipping_address != blank %}
- {{ shipping_address.name }}
{% if shipping_address.company != blank %}
- {{ shipping_address.company }}
{% endif %}
- {{ shipping_address.address1 }}
{% if shipping_address.address2 != blank %}
- {{ shipping_address.address2 }}
{% endif %}
- {{ shipping_address.city }} {% if shipping_address.province_code != blank %}{{ shipping_address.province_code | replace: "ENG", "" }}{% else %}{{ shipping_address.province | replace: "England", "" }}{% endif %}
- {{ shipping_address.zip | upcase }}
{% if shop.country != shipping_address.country %}
- {{ shipping_address.country }}
{% endif %}
- Tel. {{ shipping_address.phone }}
{% endif %}
- Order No:
{{ order.name }}
- Order Date:
{{ order.created_at | date: "%d %B, %Y" }}
{% assign transaction_text = "" %}
{% for transaction in transactions %}
{% if transaction.status != "failure" and transaction.status != "error" %}
{% if transaction.kind == "authorization" or transaction.kind == "sale" %}
{% if transaction.payment_details.credit_card_company != blank and transaction.payment_details.credit_card_company != "unknown" %}
{% capture t_text %}{{ transaction.payment_details.credit_card_company }}{% endcapture %}
{% else %}
{% capture t_text %}{{ transaction.gateway | replace: "_", " " | capitalize }}{% endcapture %}
{% endif %}
{% unless transaction_text contains t_text %}
{% if transaction_text != blank %}
{% assign transaction_text = transaction_text | append: ", " %}
{% endif %}
{% assign transaction_text = transaction_text | append: t_text %}
{% endunless %}
{% endif %}
{% endif %}
{% endfor %}
{% if transaction_text != blank and transaction_text != "manual" %}
- Payment:
{{ transaction_text }}
{% endif %}
{% if shipping_method.title != blank %}
- Fulfilment:
{{ shipping_method.title }}
{% endif %}
{% assign total_items_count = 0 %}
{% for line_item in line_items %}
{% assign total_items_count = total_items_count | plus: line_item.quantity %}
{% endfor %}
- Total Items:
{{ total_items_count }}
- Email:
{{ email }}
{% assign line_items = line_items | sort: "vendor" %}
{% assign hidden_variant_ids = "" %}
{% for line_item in line_items %}
{% if line_item.properties._boldVariantIds %}
{% assign hidden_variant_ids = hidden_variant_ids | append: ',' %}
{% assign hidden_variant_ids = hidden_variant_ids | append: line_item.properties._boldVariantIds %}
{% endif %}
{% endfor %}
{% assign hidden_variant_ids = hidden_variant_ids | split: ',' %}
{% for line_item in line_items %}
{% if line_item.quantity < 1 %}{% continue %}{% endif %}
{% if hidden_variant_ids contains line_item.variant_id %}{% continue %}{% endif %}
{% assign adjusted_item_price = line_item.price %}
{% assign adjusted_line_price = line_item.price | times: line_item.quantity %}
{% for line_item2 in line_items %}
{% if line_item.properties._boldVariantIds contains line_item2.variant_id %}
{% assign adjusted_item_price = adjusted_item_price | plus: line_item2.price %}
{% assign adjusted_line_option_price = line_item2.price | times: line_item.quantity %}
{% assign adjusted_line_price = adjusted_line_price | plus: adjusted_line_option_price %}
{% endif %}
{% endfor %}
{% endfor %}
<table>
<tr>
<th colspan="2">
Item Description
</th>
<th>
Qty
</th>
<th>
Price
</th>
<th>
Total
</th>
</tr>
<tr>
<td>
{% if line_item.image != blank %}{% endif %}
</td>
<td>
[{% if line_item.vendor != blank %}{{ line_item.vendor | append:' - ' }}{% endif %}
{{ line_item.title | replace: " - Default Title", "" }}](https://{{ shop.domain }}/products/{{ line_item.product.handle }})
{% if line_item.sku != blank %}
{{ line_item.sku }}
{% endif %}
{% for p in line_item.properties %}
{% assign p_internal = p.first | slice: 0 %}
{% unless p.first contains "builder_id" or p.first contains "builder_info" or p.first contains "master_builder" or p_internal == "_" or p.last == "" or p.last == blank %}
{% if p.last contains "cdn.shopify.com" or p.last contains "/uploads/" or p.last contains ".png?" or p.last contains ".jpg?" or p.last contains "//uploadery.s3" %}
{{ p.first }}:
{% else %}
{{ p.first }}: **{{ p.last | newline_to_br }}**
{% endif %}
{% endunless %}
{% endfor %}
{% assign refunded_quantity = 0 %}
{% for refund in refunds %}
{% for refund_line_item in refund.refund_line_items %}
{% if line_item.id == refund_line_item.line_item_id %}
{% assign refunded_quantity = refunded_quantity | plus: refund_line_item.quantity %}
{% endif %}
{% endfor %}
{% endfor %}
{% if refunded_quantity > 0 %}
Refunded × {{ refunded_quantity }}
{% endif %}
</td>
<td>
1 %}style="outline: 1px solid red !important"{% endif %}>× {{ line_item.quantity }}
</td>
<td>
{% if line_item.original_price and line_item.original_price > adjusted_item_price %}
{% assign original_price = line_item.original_price %}
{% elsif line_item.variant.compare_at_price and line_item.variant.compare_at_price > adjusted_item_price %}
{% assign original_price = line_item.variant.compare_at_price %}
{% elsif line_item.variant.price and line_item.variant.price > adjusted_item_price %}
{% assign original_price = line_item.variant.price %}
{% else %}
{% assign original_price = 0 %}
{% endif %}
{% if original_price > 0 and original_price > adjusted_item_price %}
~~{{ original_price | money }}~~
{% endif %}
{{ adjusted_item_price | money }}
</td>
<td>
{{ adjusted_line_price | money }}
</td>
</tr>
</table>
{% if note != blank or attributes != blank %}
Customer Notes
{% endif %}
{{ note | newline_to_br }}
{% for attribute in attributes %}
{% assign a_internal = attribute.first | slice: 0 %}
{% unless a_internal == "_" %}
**{{ attribute.first | replace: "-", " " | replace: "_", " " | capitalize }}:** {{ attribute.last | newline_to_br }}
{% endunless %}
{% endfor %}
{% for discount in discounts %}
{% if discount.amount != 0.00 %}
{% endif %}
{% else %}
{% if total_discounts != 0.00 %}
{% endif %}
{% endfor %}
| Discount{% if discount.code != blank %} {{ order.discount.code }}{% endif %} | -{{ order.discount.amount | money }} |
| - | - |
| Discount | -{{ order.total_discounts | money }} |
| Subtotal | {{ order.subtotal_price | money }} |
| Shipping | {{ order.shipping_price | default: 0 | money }} |
| VAT | {{ order.total_tax | default: 0 | money }} |
| Total incl. VAT | {{ order.total_price | money }} |
[
campusandcodunstable.com
](https://{{ shop.domain }})
If you have any questions, please get in touch: **lutononline@pinnaclegroupeu.com**
Thank you for your support!
MakP
June 3, 2024, 3:37pm
4
Changing {{ note }} to {{ order.note }} should solve this:
{% assign primary_font = "Roboto"%}
{% assign primary_font_color = "#000000" %}
{% assign primary_font_size = "11px"%}
{% assign secondary_font = "Roboto"%}
{% assign secondary_font_color = "#333333" %}
{% assign theme_color = "#000000"%}
Campus&Co Dunstable
campusandcodunstable.com
Bill to
{% assign billing_address = billing_address | default: customer.default_address %}
{% if billing_address and billing_address != blank %}
- {{ billing_address.name }}
{% if billing_address.company != blank %}
- {{ billing_address.company }}
{% endif %}
- {{ billing_address.address1 }}
{% if billing_address.address2 != blank %}
- {{ billing_address.address2 }}
{% endif %}
- {{ billing_address.city }}
{% if billing_address.province_code != '' %}
{{ billing_address.province_code | replace: "ENG", "" }}
{% else %}
{{ billing_address.province | default: "England" }}
{% endif %}
- {{ billing_address.zip | upcase }}
{% if shop.country != billing_address.country %}
- {{ billing_address.country }}
{% endif %}
- Tel. {{ billing_address.phone | default: customer.phone }}
{% elsif customer != blank %}
{% if customer.name != blank %}
- {{ customer.name }}
{% endif %}
{% if order.customer.email != blank %}
- {{ order.customer.email }}
{% endif %}
{% if customer.phone != blank %}
- Tel. {{ customer.phone }}
{% endif %}
{% endif %}
{% if shipping_address and shipping_address != "" and shipping_address != nil %}
Deliver to
{% endif %}
{% if shipping_address and shipping_address != blank %}
- {{ shipping_address.name }}
{% if shipping_address.company != blank %}
- {{ shipping_address.company }}
{% endif %}
- {{ shipping_address.address1 }}
{% if shipping_address.address2 != blank %}
- {{ shipping_address.address2 }}
{% endif %}
- {{ shipping_address.city }} {% if shipping_address.province_code != blank %}{{ shipping_address.province_code | replace: "ENG", "" }}{% else %}{{ shipping_address.province | replace: "England", "" }}{% endif %}
- {{ shipping_address.zip | upcase }}
{% if shop.country != shipping_address.country %}
- {{ shipping_address.country }}
{% endif %}
- Tel. {{ shipping_address.phone }}
{% endif %}
- Order No:
{{ order.name }}
- Order Date:
{{ order.created_at | date: "%d %B, %Y" }}
{% assign transaction_text = "" %}
{% for transaction in transactions %}
{% if transaction.status != "failure" and transaction.status != "error" %}
{% if transaction.kind == "authorization" or transaction.kind == "sale" %}
{% if transaction.payment_details.credit_card_company != blank and transaction.payment_details.credit_card_company != "unknown" %}
{% capture t_text %}{{ transaction.payment_details.credit_card_company }}{% endcapture %}
{% else %}
{% capture t_text %}{{ transaction.gateway | replace: "_", " " | capitalize }}{% endcapture %}
{% endif %}
{% unless transaction_text contains t_text %}
{% if transaction_text != blank %}
{% assign transaction_text = transaction_text | append: ", " %}
{% endif %}
{% assign transaction_text = transaction_text | append: t_text %}
{% endunless %}
{% endif %}
{% endif %}
{% endfor %}
{% if transaction_text != blank and transaction_text != "manual" %}
- Payment:
{{ transaction_text }}
{% endif %}
{% if shipping_method.title != blank %}
- Fulfilment:
{{ shipping_method.title }}
{% endif %}
{% assign total_items_count = 0 %}
{% for line_item in line_items %}
{% assign total_items_count = total_items_count | plus: line_item.quantity %}
{% endfor %}
- Total Items:
{{ total_items_count }}
- Email:
{{ email }}
{% assign line_items = line_items | sort: "vendor" %}
{% assign hidden_variant_ids = "" %}
{% for line_item in line_items %}
{% if line_item.properties._boldVariantIds %}
{% assign hidden_variant_ids = hidden_variant_ids | append: ',' %}
{% assign hidden_variant_ids = hidden_variant_ids | append: line_item.properties._boldVariantIds %}
{% endif %}
{% endfor %}
{% assign hidden_variant_ids = hidden_variant_ids | split: ',' %}
{% for line_item in line_items %}
{% if line_item.quantity < 1 %}{% continue %}{% endif %}
{% if hidden_variant_ids contains line_item.variant_id %}{% continue %}{% endif %}
{% assign adjusted_item_price = line_item.price %}
{% assign adjusted_line_price = line_item.price | times: line_item.quantity %}
{% for line_item2 in line_items %}
{% if line_item.properties._boldVariantIds contains line_item2.variant_id %}
{% assign adjusted_item_price = adjusted_item_price | plus: line_item2.price %}
{% assign adjusted_line_option_price = line_item2.price | times: line_item.quantity %}
{% assign adjusted_line_price = adjusted_line_price | plus: adjusted_line_option_price %}
{% endif %}
{% endfor %}
{% endfor %}
<table>
<tr>
<th colspan="2">
Item Description
</th>
<th>
Qty
</th>
<th>
Price
</th>
<th>
Total
</th>
</tr>
<tr>
<td>
{% if line_item.image != blank %}{% endif %}
</td>
<td>
[{% if line_item.vendor != blank %}{{ line_item.vendor | append:' - ' }}{% endif %}
{{ line_item.title | replace: " - Default Title", "" }}](https://{{ shop.domain }}/products/{{ line_item.product.handle }})
{% if line_item.sku != blank %}
{{ line_item.sku }}
{% endif %}
{% for p in line_item.properties %}
{% assign p_internal = p.first | slice: 0 %}
{% unless p.first contains "builder_id" or p.first contains "builder_info" or p.first contains "master_builder" or p_internal == "_" or p.last == "" or p.last == blank %}
{% if p.last contains "cdn.shopify.com" or p.last contains "/uploads/" or p.last contains ".png?" or p.last contains ".jpg?" or p.last contains "//uploadery.s3" %}
{{ p.first }}:
{% else %}
{{ p.first }}: **{{ p.last | newline_to_br }}**
{% endif %}
{% endunless %}
{% endfor %}
{% assign refunded_quantity = 0 %}
{% for refund in refunds %}
{% for refund_line_item in refund.refund_line_items %}
{% if line_item.id == refund_line_item.line_item_id %}
{% assign refunded_quantity = refunded_quantity | plus: refund_line_item.quantity %}
{% endif %}
{% endfor %}
{% endfor %}
{% if refunded_quantity > 0 %}
Refunded × {{ refunded_quantity }}
{% endif %}
</td>
<td>
1 %}style="outline: 1px solid red !important"{% endif %}>× {{ line_item.quantity }}
</td>
<td>
{% if line_item.original_price and line_item.original_price > adjusted_item_price %}
{% assign original_price = line_item.original_price %}
{% elsif line_item.variant.compare_at_price and line_item.variant.compare_at_price > adjusted_item_price %}
{% assign original_price = line_item.variant.compare_at_price %}
{% elsif line_item.variant.price and line_item.variant.price > adjusted_item_price %}
{% assign original_price = line_item.variant.price %}
{% else %}
{% assign original_price = 0 %}
{% endif %}
{% if original_price > 0 and original_price > adjusted_item_price %}
~~{{ original_price | money }}~~
{% endif %}
{{ adjusted_item_price | money }}
</td>
<td>
{{ adjusted_line_price | money }}
</td>
</tr>
</table>
{% if order.note != blank or attributes != blank %}
Customer Notes
{% endif %}
{{ order.note | newline_to_br }}
{% for attribute in attributes %}
{% assign a_internal = attribute.first | slice: 0 %}
{% unless a_internal == "_" %}
**{{ attribute.first | replace: "-", " " | replace: "_", " " | capitalize }}:** {{ attribute.last | newline_to_br }}
{% endunless %}
{% endfor %}
{% for discount in discounts %}
{% if discount.amount != 0.00 %}
{% endif %}
{% else %}
{% if total_discounts != 0.00 %}
{% endif %}
{% endfor %}
| Discount{% if discount.code != blank %} {{ order.discount.code }}{% endif %} | -{{ order.discount.amount | money }} |
| - | - |
| Discount | -{{ order.total_discounts | money }} |
| Subtotal | {{ order.subtotal_price | money }} |
| Shipping | {{ order.shipping_price | default: 0 | money }} |
| VAT | {{ order.total_tax | default: 0 | money }} |
| Total incl. VAT | {{ order.total_price | money }} |
[
campusandcodunstable.com
](https://{{ shop.domain }})
If you have any questions, please get in touch: **lutononline@pinnaclegroupeu.com**
Thank you for your support!