Migrating your templates from the Order Printer app to Shopify Order Printer

If you have any custom templates in the legacy Order Printer app, then you need to migrate your templates to the Shopify Order Printer app.

To migrate your templates, you need to copy your template's code from the legacy app, and then paste the code into the new app. However, the new Shopify Order Printer app has a slightly different implementation than the legacy Order Printer app. This means that some of your existing templates might not work initially and you might need to make some adjustments to your template's code.

To make your templates work in the new app, you need to replace the legacy variables with the new variables. For example, if you use the date variable, then you need to replace with it the created_at variable.

On this page you can find a list of variables that you might need to replace with new variables in the Shopify Order Printer app.

Considerations for migrating your existing templates

Before you migrate your existing templates to the Shopify Order Printer app, review the following considerations:

Migrate your existing templates to the Shopify Order Printer app

To migrate your existing templates to the Shopify Order Printer app, you need to complete the following steps:

  1. Go to the legacy Order Printer app and identify which templates you want to migrate.
  2. Copy the existing template's code from the legacy Order Printer app.
  3. Create a new template in the Shopify Order Printer app, and then paste your template's code from the legacy app.
  4. Review whether your template uses any of the legacy variables, and then replace them with the new variables.
  5. Preview your template and make sure that the template displays correctly.
  6. Print a test document.

Repeat these steps for each template that you want to migrate to the Shopify Order Printer app.

Using order variables in the Shopify Order Printer app

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
  • discounts
  • 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.

Variable mapping

The Shopify Order Printer app uses different variables to the legacy Order Printer app. If your existing templates use any of the variables listed in this section, then you need to replace your old variables with new variables.

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

Order variables

Order variable
Variable in the legacy Order Printer appVariable in the new Shopify Order Printer app
line_itemsRefunded line items aren't included in the line_items variable. Access refunded line items using the refunds.<each>.refunded_line_items variable.
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: {{ order.created_at | date: "%B %e, %Y" }}.
gateways unique_gateways or transactions.<each>.gateway
order_currencycurrency
processed_atUse the created_at variable. Use the date filter to format the timestamp: {{ order.created_at | date: "%B %e, %Y" }}.
payment_transactionsFilter down order.transactions for kind and status in the Liquid syntax with where or with looping and an if inside.
refund_transactionsFilter down order.transactions for kind and status in the Liquid syntax with where or with looping and an if inside.
shipping_lineshipping_methods | first
shipping_linesshipping_methods
show_line_item_taxes tax_lines.size > 0. You can define it as a variable in the beginning of the template and refer multiple times: {% 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 ? 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: {{ 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 variables

Filter mapping
Variable in the legacy Order Printer appVariable in the new Shopify Order Printer app
files_urlfile_url
payment_method and payment_methods Use the transaction.gateway_display_name field on order transactions. Payment methods are no longer categorised 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.
Ready to start selling with Shopify?Try it free