Troubleshooting issues for your imported Order Printer templates

When you migrate your templates from the legacy Order Printer app to the new Shopify Order Printer app, your Liquid variables are updated to ensure compatibility with the new app. In rare cases, you might need to troubleshoot your imported templates.

If your imported templates aren't printing correctly, then you might need to manually edit your template's code in the new Shopify Order Printer app. Review the following most common reasons why templates might not import correctly:

  • Templates include custom CSS
  • Templates contain metafields
  • Liquid variables might not update correctly

On this page you can find detailed information on how to troubleshoot potential issues when importing your custom templates to the new Shopify Order Printer app.

Updating common CSS design customizations

If the templates that you're transferring include custom CSS, then you might need to manually update the CSS code in your templates to correctly display design elements, such as images, custom fonts, logos, or barcodes.

Updating metafield variables

To access a metafield, you need to specify the metafield's namespace, and you don't need to add the .value to the variable. Learn more about metafield definitions.

For example, instead of the product.metafields.custom.manufacturerid.value variable, use theproduct.metafields.custom.manufacturerid variable.

To identify namespace values for each metafield, refer to the Custom data page in your Shopify admin. metafield definitions are grouped by the objects they refer to, such as products, variants, or orders.

Updating common Liquid variables

In most cases your Liquid variables automatically update during the migration process. However, if your templates don't migrate correctly and you use any of the variables listed in this section, then you might need to replace your old variables with new variables manually. The Shopify Order Printer app uses different variables to the legacy Order Printer app.

For example, if you use the date variable, then you need to replace it with the created_at variable.

Order variables

Order variables are used differently in the Shopify Order Printer app. To access order variables, you need to add the order. prefix. For example, to access the billing_address variable, you need to use order.billing_address.

The following commonly used order variables are accessible without the order. prefix:

  • line_items
  • tax_lines
  • fulfillments
  • transactions
  • refunds
  • shipping_methods
  • customer

For example, if you want to access the line items variable, you can use line_items or order.line_items.

You can also make your own aliases for your template. For example, you can use the {% assign fulfillments_count = order.fulfillments | size %} Liquid syntax, and then reference it by using {{ fulfillments_count }} in your code.

Order variable
Variable in the legacy Order Printer appVariable in the new Shopify Order Printer app
line_items
  • Refunded line items aren't included in the line_items variable. Review the following details:
    • You can access refunded line items using the refunds.<each>.refund_line_items variable. Review the following example.
      {% assign refunded_line_items = refunds | map: "refund_line_items" | map: "line_item" %}
    • You can join the refunded line items to the line_items collection if you want to. Review the following example.
      {% assign refunded_line_items = order.refunds | map: "refund_line_items" | map: "line_item" %} {% assign line_items_with_refunded = order.line_items | concat: refunded_line_items | uniq %}
    • You should ensure that you include the | uniq filter in order to avoid duplication of the refunded line items.
  • Tip line items aren't included in the line_items variable. Review the following details:
    • You can access tip line items using the tip_line_items variable.
    • You can join tip_line_items to the line_items collection if you want to. Review the following example.
      {% assign line_items_with_tips = order.line_items | concat: order.tip_line_items %}
  • To mimic the legacy Order Printer line_items collection, you can use the following example code.
    {% assign refunded_line_items = refunds | map: "refund_line_items" | map: "line_item" %} {% assign all_line_items = order.line_items | concat: refunded_line_items | concat: order.tip_line_items | uniq %} {% for line_item in all_line_items %} ... {% endfor %}
credit_cardUse payment details based on each transaction from the order with the transactions.<each>.payment_details variable.
current_shipping_priceshipping_price
dateUse the created_at variable. Use the date filter to format the timestamp, for example with {{ order.created_at | date: "%B %e, %Y" }}.
gatewaysunique_gateways or transactions.<each>.gateway
order_currencycurrency
processed_atUse the created_at variable. It holds the value of order.processed_at from the GraphQL API, and it means the actual time that the order is processed at, rather than the time that the order is imported into Shopify. It is the same as order.processed_at from the legacy Order Printer app. You can use the date filter to format the timestamp, for example with {{ order.created_at | date: "%B %e, %Y" }}.
payment_transactions

Filter through order.transactions for the kind status in the Liquid syntax with where, or with looping and an if inside. Review the following examples.

{% assign sale_transactions = order.transactions | where: "kind", "sale" %} {% assign capture_transactions = order.transactions | where: "kind", "capture" %} {% for transaction in transactions %} {% if transaction.kind == "sale" or transaction.kind == "capture" %} Transaction ID: {{ transaction.id }} Kind: {{ transaction.kind }} Amount: {{ transaction.amount | money }} {% endif %} {% endfor %}

{% assign sale_transactions = order.transactions | where: "kind", "sale" %} {% assign capture_transactions = order.transactions | where: "kind", "capture" %} {% assign payment_transactions = sale_transactions | concat: capture_transactions %}

refund_transactionsFilter through order.transactions for the kind status in the Liquid syntax with where, or with looping and an if inside, as with the following example.
{% assign refund_transactions = order.transactions | where: "kind", "refund" %}
shipping_lineshipping_methods | first
shipping_linesshipping_methods
show_line_item_taxestax_lines.size > 0. You can define it as a variable in the beginning of the template and refer to it multiple times, as with the following example.
{% if tax_lines.size > 0 %} {% assign show_line_item_taxes = true %} {% else %} {% assign show_line_item_taxes = false %} {% endif %}
total_taxtax_price
total_paidnet_payment

LineItem variables

LineItem variable
Variable in the legacy Order Printer appVariable in the new Shopify Order Printer app
fulfillable_quantityquantity - successfully_fulfilled_quantity
fulfilledquantity == successfully_fulfilled_quantity
nametitle
product_titleproduct.title
unit_discountquantity ? line_level_total_discount / quantity : 0
variant_titlevariant.title
weightgrams

Fulfillment variables

fulfillment variable
Variable in the legacy Order Printer appVariable in the new Shopify Order Printer app
datecreated_at

Shop variables

Shop variable
Variable in the legacy Order Printer appVariable in the new Shopify Order Printer app
owneraccount_owner.name
addressshop.address.address1
address2shop.address.address2
cityshop.address.city
countryshop.address.country
country_codeshop.address.country_code
provinceshop.address.province
province_codeshop.address.province_code
zipshop.address.zip

Address variables

Address variable
Variable in the legacy Order Printer appVariable in the new Shopify Order Printer app
latitudeIf the address variable was referenced from the location atrribute, then the latitude and longitude are available on the location object itself.
longitudeIf the address variable was referenced from the location atrribute, then the latitude and longitude are available on the location object itself.

Refund variables

Refund variable
Variable in the legacy Order Printer appVariable in the new Shopify Order Printer app
dateUse the created_at variable. Use the date filter to format the timestamp, for example with {{ order.created_at | date: "%B %e, %Y" }}.

ShippingLine variables

ShippingLine variable
Variable in the legacy Order Printer appVariable in the new Shopify Order Printer app
current_priceprice
priceoriginal_price

Transaction variables

The following transaction variables were removed and can't be replaced in the Shopify Order Printer app:

  • authorization
  • message
  • test

Variant variables

variant variable
Variable in the legacy Order Printer appVariable in the new Shopify Order Printer app
gramsweight

Metafield variables

To access a metafield, you need to specify the metafield's Namespace, and don't need to add the .value to the variable. Learn more about metafield definitions.

For example, instead of product.metafields.manufacturerid.value variable, use product.metafields.custom.manufacturerid variable.

To identify Namespace values for each metafield, refer to the Custom data page in your Shopify admin. Metafield definitions are grouped by the objects they refer to, such as products, variants, or orders.

Filter mapping

Filter mapping
Filter name in the legacy Order Printer appFilter name in the new Shopify Order Printer app
files_urlfile_url
payment_method and payment_methodsUse the transaction.gateway_display_name field on order transactions. Payment methods are no longer categorized into specific types, such as {credit card, debit card, bank transfer}. The legacy Order Printer app mapped only a small subset of currently functioning payment gateways to these categories. Payment gateway providers manage the types of payment methods used by customers on their side.
Can’t find the answers you’re looking for? We’re here to help.