# Order Printerや明細票のテンプレートに定期購入の情報を入れたい

**URL:** <https://community.shopify.com/t/order-printer/78156>\
**Category:** 技術的なQ＆A\
**Created:** [November 15, 2021, 7:16am UTC](https://community.shopify.com/t/order-printer/78156 "2021-11-15T07:16:39Z")\
**Posts on this page:** 1\
**Page:** 1

## AI-generated summary

ShopifyのOrder Printer（明細票）テンプレートに、定期購入（サブスク）の該当プラン名を表示したいという技術的質問。

- 試したこと: 注文確認メールのコードを参考に、line_itemsのループ内で
  {% if line.selling_plan_allocation %} {{ line.selling_plan_allocation.selling_plan.name }} {% endif %}
  を挿入したが、出力されない。

- 目的: 明細票のテンプレートに、各明細の定期購入プラン情報（プラン名）を表示したい。

- 背景: 注文確認メールでは取得できるコードを、Order Printerのテンプレートでも使いたいが、同様に動作しない。

- 用語説明: selling_plan_allocation は、対象ラインアイテムに紐づく定期購入（Selling Plan）の割り当て情報。selling_plan.name はそのプラン名。

- 現状: 解決策・具体的な実装手順は提示されておらず、質問は未解決で継続中。未回答の論点は「Order Printerの明細票で定期購入プラン情報を正しく参照・出力する方法」。

<div class="post-metadata">

**Author:** ![Hisada](https://avatars.discourse-cdn.com/v4/letter/h/ea5d25/32.png) [@Hisada](https://community.shopify.com/u/Hisada)\
**Post date:** [November 15, 2021, 7:16am UTC](https://community.shopify.com/t/order-printer/78156/1 "2021-11-15T07:16:39Z")

</div>

Order Printerや明細票のテンプレートに定期購入の該当プランの情報を入れたいのですが

> {% if line.selling\_plan\_allocation %}\> {{ line.selling\_plan\_allocation.selling\_plan.name }}\> {% endif %}

注文確認メールのコードを参考に用意した上のコードを{% for line\_item in line\_items %}のループ内に挿入しても出力されません。  
どのようにすれば明細票のテンプレートに定期購入の該当プランの情報を入れることが出来ますか。
