Migrate from the Order Printer app to Shopify Order Printer

The Liquid implementation in Shopify's Order Printer slightly differs from the original Order Printer. To migrate your templates, you'll need to manually copy the code from your existing templates, paste them into the new app, and make the necessary adjustments as outlined in this guide. Any custom CSS added to your templates will also need to be transferred and adjusted in the new app.

Order attributes being removed from the global namespace

To access order attributes, prepend them with order.. For instance, billing_address is now accessed as order.billing_address.

For your convenience, several commonly used order attributes are still accessible without the order. prefix:

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

These variables can be accessed either as fulfillments or order.fulfillments, and so on.

Fields deprecations

In accordance with the up-to-date Shopify data model, multiple fields on several objects were renamed or deprecated with a replacement or a workaround provided in the paragraphs below. If your templates access any of them, then replace them with the provided replacement fields or code fragments.

Order

Implementation differences:

  • line_items. Refunded line items aren't included in the line_items collection. Access refunded line items through refunds.<each>.refunded_line_items.

Fields deprecated with replacements given:

  • credit_card. Use payment details based on each transaction from the order: transactions.each.payment_details.
  • current_shipping_price. Use shipping_price instead.
  • date. Use created_at instead.
  • gateways. Use unique_gateways or transactions.<each>.gateway instead.
  • order_currency. Use currency instead.
  • processed_at. Use created_at instead.
  • payment_transactions. Filter down order.transactions for kind and status in the Liquid syntax with where or with looping and an if inside.
  • refund_transactions. Filter down order.transactions for kind and status in the Liquid syntax with where or with looping and an if inside.
  • shipping_line. Use shipping_methods | first.
  • shipping_lines. Use shipping_methods.
  • show_line_item_taxes. Do tax_lines.size > 0. You can define it as a variable in the beginning of the template and refer multiple times: {% assign show_line_item_taxes = tax_lines.size > 0 %}.
  • total_tax. Use tax_price.
  • total_paid. Use net_payment.

LineItem

Fields deprecated with replacements given:

  • fulfillable_quantity. Use quantity - successfully_fulfilled_quantity.
  • fulfilled. Calculate quantity == successfully_fulfilled_quantity condition.
  • name. Use title.
  • product_title. Use product.title.
  • unit_discount. Calculate quantity ? total_discount / quantity : 0.
  • variant_title. Use variant.title.
  • weight. Use grams.

Fulfillment

Fields deprecated with replacements given:

  • date. Use created_at.

Shop

Fields deprecated with replacements given:

  • owner - Use account_owner.name.

For the following fields, refer them as shop.address.<field_name>:

  • address - Use shop.address.address1.
  • address2 - Use shop.address.address2.
  • city - Use shop.address.city.
  • country - Use shop.address.country.
  • country_code - Use shop.address.country_code.
  • province - Use shop.address.province.
  • province_code - Use shop.address.province_code.
  • zip - Use shop.address.zip.

Address

Fields deprecated with replacements given:

  • latitude - if address was referenced from location, latitude and longitude are available on the location object itself.
  • Longitude - if address was referenced from location, latitude and longitude are available on the location object itself.

Refund

Fields deprecated with replacements given:

  • date. Use created_at.

ShippingLine

Fields deprecated with replacements given:

  • current_price. Use price.
  • price. Use original_price.

Transaction

Removed fields:

  • authorization
  • message
  • test

Variant

Fields deprecated with replacements given:

  • grams. Use weight.

Filters deprecations

Fields deprecated with replacements given:

  • files_url. Use file_url.
  • payment_method, payment_methods. Use 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 older Order Printer 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 answers you're looking for? We're here to help you.