Migrating 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 can import your existing templates to the Shopify Order Printer 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.
On this page
Considerations for migrating your existing templates
Before you migrate your existing templates to the Shopify Order Printer app, review the following considerations:
- To migrate your existing templates, you need to be familiar with HTML, CSS, and Liquid. Shopify Theme Support can help with minor adjustments within the scope of the Shopify Design Policy.
- Review the Liquid variables and filters reference for Shopify Order Printer for all supported template customizations.
- If your existing templates use custom CSS, then you need to manually transfer and adjust the code in the new app.
- To access order variables in the Shopify Order Printer app, you need to add the order prefix.
- When importing existing templates, metafields aren't imported. You might need to manually migrate templates that contain metafields.
Migrate your existing templates to the Shopify Order Printer app
If you have existing templates from the legacy Order Printer app, then you can import them to the Shopify Order Printer app. You can't import specific templates, you can only import all your templates at same time.
Steps:
- From your Shopify admin, click Settings > Apps and sales channels.
- Click Order Printer.
Click Open app.
Click Templates.
Click Import.
In the dialog, click Import.
Preview your templates and make sure that the templates display correctly.
Optional: Print test documents.
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
-
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 it with the created_at
variable.
Order variables
Variable in the legacy Order Printer app | Variable in the new Shopify Order Printer app |
---|---|
line_items |
|
credit_card | Use payment details based on each transaction from the order with the transactions.<each>.payment_details variable. |
current_shipping_price | shipping_price |
date | Use the created_at variable. Use the date filter to format the timestamp, for example with {{ order.created_at | date: "%B %e, %Y" }} . |
gateways |
unique_gateways or transactions.<each>.gateway
|
order_currency | currency |
processed_at | Use 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
|
refund_transactions | Filter 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_line | shipping_methods | first |
shipping_lines | shipping_methods |
show_line_item_taxes |
tax_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_tax | tax_price |
total_paid | net_payment |
LineItem variables
Variable in the legacy Order Printer app | Variable in the new Shopify Order Printer app |
---|---|
fulfillable_quantity | quantity - successfully_fulfilled_quantity |
fulfilled | quantity == successfully_fulfilled_quantity |
name | title |
product_title | product.title |
unit_discount | quantity ? line_level_total_discount / quantity : 0 |
variant_title | variant.title |
weight | grams |
Fulfillment variables
Variable in the legacy Order Printer app | Variable in the new Shopify Order Printer app |
---|---|
date | created_at |
Shop variables
Variable in the legacy Order Printer app | Variable in the new Shopify Order Printer app |
---|---|
owner | account_owner.name |
address | shop.address.address1 |
address2 | shop.address.address2 |
city | shop.address.city |
country | shop.address.country |
country_code | shop.address.country_code |
province | shop.address.province |
province_code | shop.address.province_code |
zip | shop.address.zip |
Address variables
Variable in the legacy Order Printer app | Variable in the new Shopify Order Printer app |
---|---|
latitude | If the address variable was referenced from the location atrribute, then the latitude and longitude are available on the location object itself. |
longitude | If the address variable was referenced from the location atrribute, then the latitude and longitude are available on the location object itself. |
Refund variables
Variable in the legacy Order Printer app | Variable in the new Shopify Order Printer app |
---|---|
date | Use the created_at variable. Use the date filter to format the timestamp, for example with {{ order.created_at | date: "%B %e, %Y" }} . |
ShippingLine variables
Variable in the legacy Order Printer app | Variable in the new Shopify Order Printer app |
---|---|
current_price | price |
price | original_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
Variable in the legacy Order Printer app | Variable in the new Shopify Order Printer app |
---|---|
grams | weight |
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 name in the legacy Order Printer app | Filter name in the new Shopify Order Printer app |
---|---|
files_url | file_url |
payment_method and payment_methods
| Use 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. |