가져온 Order Printer 템플릿 문제 해결하기

레거시 Order Printer 앱에서 새로운 Shopify Order Printer 앱으로 템플릿을 마이그레이션하면 새 앱과의 호환성을 위해 Liquid 변수가 업데이트됩니다. 드물게 가져온 템플릿의 문제를 해결해야 할 수도 있습니다.

가져온 템플릿이 올바르게 인쇄되지 않는 경우 새 Shopify Order Printer 앱에서 템플릿 코드를 수동으로 편집해야 할 수 있습니다. 다음은 템플릿을 올바르게 가져오지 못할 수 있는 가장 일반적인 이유입니다.

  • 템플릿에 사용자 지정 CSS 포함
  • 템플릿에 메타 필드 포함
  • Liquid 변수가 올바르게 업데이트되지 않을 수 있음

이 페이지에서는 사용자 지정 템플릿을 새 Shopify Order Printer 앱으로 가져올 때 발생할 수 있는 잠재적 문제를 해결하는 방법에 대한 자세한 정보를 찾을 수 있습니다.

일반적인 CSS 디자인 맞춤 설정 업데이트

전송하는 템플릿에 사용자 지정 CSS가 포함된 경우, 이미지, 커스텀 폰트, 로고 또는 바코드와 같은 디자인 요소를 올바르게 표시하려면 템플릿의 CSS 코드를 수동으로 업데이트해야 할 수 있습니다.

메타 필드 변수 업데이트

메타 필드에 액세스하려면 메타 필드의 네임스페이스를 지정해야 하며 변수에 .value를 추가할 필요가 없습니다. 메타 필드 정의에 대해 자세히 알아보십시오.

예를 들어 product.metafields.custom.manufacturerid.value 변수 대신 product.metafields.custom.manufacturerid 변수를 사용하십시오.

각 메타 필드의 네임스페이스 값을 확인하려면 Shopify 관리자의 사용자 지정 데이터 페이지를 참조하십시오. 메타 필드 정의는 제품, 이형 상품, 주문 등 참조하는 개체별로 그룹화됩니다.

일반적인 Liquid 변수 업데이트

대부분의 경우 Liquid 변수는 마이그레이션 프로세스 중에 자동으로 업데이트됩니다. 하지만 템플릿이 올바르게 마이그레이션되지 않고 이 섹션에 나열된 변수를 사용하는 경우 이전 변수를 새 변수로 수동으로 바꿔야 할 수 있습니다. Shopify Order Printer 앱은 레거시 Order Printer 앱과 다른 변수를 사용합니다.

예를 들어 date 변수를 사용하는 경우 created_at 변수로 바꿔야 합니다.

주문 변수

주문 변수는 Shopify Order Printer 앱에서 다르게 사용됩니다. 주문 변수에 액세스하려면 order. 접두사를 추가해야 합니다. 예를 들어 billing_address 변수에 액세스하려면 order.billing_address를 사용해야 합니다.

다음의 일반적으로 사용되는 주문 변수는 order. 접두사 없이 액세스할 수 있습니다.

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

예를 들어 품목 변수에 액세스하려면 line_items 또는 order.line_items를 사용할 수 있습니다.

템플릿에 대한 자신만의 별칭을 만들 수도 있습니다. 예를 들어 {% assign fulfillments_count = order.fulfillments | size %} Liquid 구문을 사용한 다음 코드에서 {{ fulfillments_count }}를 사용하여 참조할 수 있습니다.

주문 변수
레거시 Order Printer 앱의 변수새 Shopify Order Printer 앱의 변수
line_items
  • 환불된 품목 은(는) line_items 변수에 포함되지 않습니다. 다음 세부 정보를 검토하십시오.
    • refunds.<each>.refund_line_items 변수를 사용하여 환불된 품목에 액세스할 수 있습니다. 다음 예시를 검토하십시오.
      {% assign refunded_line_items = refunds | map: "refund_line_items" | map: "line_item" %}
    • 필요한 경우 환불된 품목을 line_items 컬렉션에 결합할 수 있습니다. 다음 예시를 검토하십시오.
      {% 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 %}
    • 환불된 품목이 중복되지 않도록 | uniq 필터를 반드시 포함해야 합니다.
  • 팁 품목 은(는) line_items 변수에 포함되지 않습니다. 다음 세부 정보를 검토하십시오.
    • tip_line_items 변수를 사용하여 팁 품목에 액세스할 수 있습니다.
    • 필요한 경우 tip_line_itemsline_items 컬렉션에 결합할 수 있습니다. 다음 예시를 검토하십시오.
      {% assign line_items_with_tips = order.line_items | concat: order.tip_line_items %}
  • 레거시 Order Printer line_items 컬렉션을 모방하려면 다음 예시 코드를 사용할 수 있습니다.
    {% 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_cardtransactions.<each>.payment_details 변수를 사용하여 주문의 각 거래에 대한 결제 세부 정보를 사용하십시오.
current_shipping_priceshipping_price
datecreated_at 변수를 사용하십시오. 예를 들어 {{ order.created_at | date: "%B %e, %Y" }}와 같이 date 필터를 사용하여 타임스탬프의 서식을 지정하십시오.
gatewaysunique_gateways 또는 transactions.<each>.gateway
order_currencycurrency
processed_atcreated_at 변수를 사용하십시오. GraphQL API의 order.processed_at 값을 포함하며, 주문이 Shopify로 가져온 시간이 아닌 주문이 처리된 실제 시간을 의미합니다. 레거시 Order Printer 앱의 order.processed_at와 동일합니다. date 필터를 사용하여 타임스탬프의 서식을 지정할 수 있습니다(예: {{ order.created_at | date: "%B %e, %Y" }}).
payment_transactions

where를 사용하거나 루핑 및 내부 if를 사용하여 Liquid 구문의 kind 상태에 대한 order.transactions를 필터링하십시오. 다음 예시를 검토하십시오.

{% 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_transactions다음 예시와 같이 where를 사용한 Liquid 구문 또는 루프와 내부 if를 사용하여 order.transactions에서 kind 상태를 필터링합니다.
{% assign refund_transactions = order.transactions | where: "kind", "refund" %}
shipping_lineshipping_methods | first
shipping_linesshipping_methods
show_line_item_taxestax_lines.size > 0. 다음 예시와 같이 템플릿 시작 부분에 이를 변수로 정의하고 여러 번 참조할 수 있습니다.
{% 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 변수

LineItem 변수
레거시 Order Printer 앱의 변수새 Shopify Order Printer 앱의 변수
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

주문 처리 변수

주문 처리 변수
레거시 Order Printer 앱의 변수새 Shopify Order Printer 앱의 변수
datecreated_at

Shop 변수

Shop 변수
레거시 Order Printer 앱의 변수새 Shopify Order Printer 앱의 변수
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

주소 변수

주소 변수
레거시 Order Printer 앱의 변수새 Shopify Order Printer 앱의 변수
latitudeaddress 변수가 location 특성에서 참조된 경우 위도 및 경도는 location 개체 자체에서 사용할 수 있습니다.
longitudeaddress 변수가 location 특성에서 참조된 경우 위도 및 경도는 location 개체 자체에서 사용할 수 있습니다.

환불 변수

환불 변수
레거시 Order Printer 앱의 변수새 Shopify Order Printer 앱의 변수
datecreated_at 변수를 사용하십시오. 예를 들어 {{ order.created_at | date: "%B %e, %Y" }}와 같이 date 필터를 사용하여 타임스탬프의 서식을 지정하십시오.

ShippingLine 변수

ShippingLine 변수
레거시 Order Printer 앱의 변수새 Shopify Order Printer 앱의 변수
current_priceprice
priceoriginal_price

거래 변수

다음 거래 변수는 제거되었으며 Shopify Order Printer 앱에서 바꿀 수 없습니다.

  • authorization
  • message
  • test

이형 상품 변수

이형 상품 변수
레거시 Order Printer 앱의 변수새 Shopify Order Printer 앱의 변수
gramsweight

메타 필드 변수

메타 필드에 액세스하려면 메타 필드의 네임스페이스를 지정해야 하며 변수에 .value를 추가할 필요가 없습니다. 메타 필드 정의에 대해 자세히 알아보십시오.

예를 들어 product.metafields.manufacturerid.value 변수 대신 product.metafields.custom.manufacturerid 변수를 사용하십시오.

각 메타 필드의 네임스페이스 값을 확인하려면 Shopify 관리자의 사용자 지정 데이터 페이지를 참조하십시오. 메타 필드 정의는 제품, 이형 상품 또는 주문과 같이 참조하는 개체별로 그룹화됩니다.

필터 매핑

필터 매핑
레거시 Order Printer 앱의 필터 이름새로운 Shopify Order Printer 앱의 필터 이름
files_urlfile_url
payment_methodpayment_methods주문 거래에서 transaction.gateway_display_name 필드를 사용하십시오. 결제 방법은 더 이상 {신용 카드, 직불 카드, 계좌 이체}와 같은 특정 유형으로 분류되지 않습니다. 레거시 Order Printer 앱은 현재 작동하는 전자결제 대행사의 일부만 이러한 범주에 매핑했습니다. 전자결제 대행사 제공업체는 고객이 사용하는 결제 방법 유형을 자체적으로 관리합니다.