# Order Printer で決済方法を日本語表示したい

**URL:** <https://community.shopify.com/t/order-printer/83596>\
**Category:** 技術的なQ＆A\
**Created:** [December 8, 2021, 7:27am UTC](https://community.shopify.com/t/order-printer/83596 "2021-12-08T07:27:15Z")\
**Posts on this page:** 3\
**Page:** 1

## AI-generated summary

Shopifyアプリ「Order Printer」のテンプレートで、決済方法の表示を英語/コード名（例: "shopify_payments"）から日本語（例: 「クレジット決済」）にしたいという相談。

主な状況:
- 「{{ gateway }}」で決済方法自体は表示できるが、日本語表記に変換したい。
- 「{{ transaction.gateway | payment_method }}」は試したものの反映されず、理由も不明。

提案された解決策:
- Liquidの`replace`フィルターを使って文字列を置換する。
  - 例: `{{ gateway | replace: "shopify_payments", "クレジットカード決済" }}`
  - 複数の決済手段は`| replace: ...`を連結して対応可能。

結論:
- `replace`で日本語化でき、相談者側で解決した。未解決点としては`payment_method`が反映されない原因はスレッド内で説明されていない。

<div class="post-metadata">

**Author:** ![yuuka\_saito](https://avatars.discourse-cdn.com/v4/letter/y/bbce88/32.png) [@yuuka\_saito](https://community.shopify.com/u/yuuka_saito)\
**Post date:** [December 8, 2021, 7:27am UTC](https://community.shopify.com/t/order-printer/83596/1 "2021-12-08T07:27:15Z")

</div>

Shopifyアプリ「Order Printer」のテンプレート編集をしています。

{{gateway}} で決済方法は表示できましたが、

“shopify\_payments”を“クレジット決済”のように日本語表記したいのです。

Liquidの書き方を教えていただけませんでしょうか。

よろしくお願いいたします。

（ {{ transaction.gateway | payment\_method }} はなぜか反映されませんでした。

こちらもなぜ反映されないのか分かる方がいたら教えていただきたいです。）

現在編集しているテンプレートです。

```markup
## 
    注文番号 {{ order_name }}

{{ "now" | date: "20%y年%m月%d日" }}

   
  {% if shipping_address %}
    ### 送付先住所
    
      **{{ shipping_address.name }}**

   
      {% if shipping_address.company %}
        {{ shipping_address.company }}

  ￼
      {% endif %}
      {{ shipping_address.zip | upcase }}
      {{ shipping_address.city }}
      {{ shipping_address.street }}

  ### 送り元

  **{{ shop.name }}**

  {{ shop.owner }}

 {{ shop.zip | upcase }} {{ shop.city }}{{ shop.address }}

### 
{% endif %} 
日付指定:{{ attributes.haisoyamatoshippingdate }}

時間指定:
{% if attributes.haisoyamatoshippingtime == "0812" %}
午前中
{% elsif attributes.haisoyamatoshippingtime == "1214" %}
12:00～14:00
{% elsif attributes.haisoyamatoshippingtime == "1416" %}
14:00～16:00
{% elsif attributes.haisoyamatoshippingtime == "1618" %}
16:00～18:00
{% elsif attributes.haisoyamatoshippingtime == "1820" %}
18:00～20:00
{% elsif attributes.haisoyamatoshippingtime == "2021" %}
20:00～21:00
{% elsif attributes.haisoyamatoshippingtime == "1921" %}
19:00～21:00
{% else %}
{% endif %}

### 決済方法：{{ gateway }}
   
  

---

   
  ### 商品詳細
   
  
        {% if show_line_item_taxes %}
        
        {% endif %}
        
      {% assign hidden_variant_ids = "" %}
      {% for line in line_items %}
          {% for prop in line.properties %}
            {% if prop.first == "_boldVariantIds" %}
              {% assign hidden_variant_ids = hidden_variant_ids | append: prop.last | append: ',' %}
            {% endif %}
          {% endfor %}
      {% endfor %}
      
      {% for line_item in line_items %}
   
      
        {% assign variant_id = line_item.variant_id | append: "" %}
        {% if hidden_variant_ids contains variant_id %}{% continue %}{% endif %}
   
        {% assign bold_item_price = line_item.price %}
        {% assign bold_line_price = line_item.line_price %}
        {% assign bold_var_ids = "" %}
        {% assign price_index = "" %}
        {% assign bold_qtys = "" %}
            {% for prop2 in line_item.properties %}
                {% if prop2.first == "_boldVariantIds" %}
                    {% assign bold_var_ids = prop2.last | split: "," %}
                {% elsif prop2.first == "_boldVariantPrices" %}
                  {% assign price_index = prop2.last | split: "," %}
                {% elsif prop2.first == "_boldVariantQtys" %}
                  {% assign bold_qtys = prop2.last | split: "," %}
                {% endif %}
            {% endfor %}
   
                {% unless price_index == "" && bold_var_ids == "" %}
                {% for price in price_index %}
                  {% assign bold_qty = 1 %}
                  {% if bold_qtys.length > 0 %}{% assign bold_qty = bold_qtys[forloop.index0] %}{% endif %}
   
                  {% assign bold_item_price = bold_item_price | plus: price %}
                  {% assign temp_price = price | times: bold_qty %}
                  {% assign bold_line_price = bold_line_price | plus: temp_price %}
                {% endfor %}
                {% endunless %}
   
        {% assign bold_options = " " %}
   
        {% for bold_option in line_item.properties %}
            {% assign first_char = bold_option.first | slice: 0, 1 %}
            {% assign opt_title = bold_option | first %}
            {% assign opt_desc = bold_option | last %}
                {% unless first_char == '_' or first_char=='_boldOptionLocalStorageId' or bold_option.first == 'master_builder' or bold_option.first == 'builder_id' or bold_option.first == '_boldOptionLocalStorageId' or bold_option.first == 'builder_info' or bold_option.last == "" %}
                  {% assign bold_options = bold_options | append: '
' | append: opt_title | append: ': ' | append: opt_desc %}
                {% endunless%}
        {% endfor %}
   
        {% assign bold_options = bold_options | prepend: '' | append: "" %}
        
          {% if line_item.tax_lines %}
            
          {% endif %}
          
      {% endfor %}
    

| 数量 | 商品名 | 消費税 | 価格 |
| - | - | - | - |
| {{ line_item.quantity }} x | <br> **{{ line_item.title }}** <br> {{ bold_options }}<br> | <br> {% for tax_line in line_item.tax_lines %}<br> {{ tax_line.price | money }} {{ tax_line.title }}<br><br> {% endfor %}<br> | <br> {% if line_item.original_price != line_item.price %}<br> ~~{{ line_item.original_price | money }}~~ <br> {% endif %}<br> {{ bold_line_price | money }}<br> |

   
  {% if transactions.size > 1 %}
    ### Transaction Details
    
        {% for transaction in transactions %}
          
        {% endfor %}
      

| Type | Amount | Kind | Status |
| - | - | - | - |
| {{ transaction.gateway | payment_method }} | {{ transaction.amount | money }} | {{ transaction.kind }} | {{ transaction.status }} |

  {% endif %}
   
  ### 支払い明細
   
  
    {% for discount in discounts %}
    
    {% endfor %}
    
    {% if shipping_address %}
      
    {% endif %}
    
    {% if total_paid != total_price %}
      
    {% endif %}
  

| 総額: | {{ subtotal_price | money }} |
| - | - |
| 値引額 "{{ discount.code }}" | {{ discount.savings | money }} |
| 消費税総額: | {{ tax_price | money }} |
| 送料: | {{ shipping_price | money }} |
| **合計金額:** | **{{ total_price | money }}** |
| **総支払い額:** | **{{ total_paid | money }}** |
| **Outstanding Amount:** | **{{ total_price | minus: total_paid | money }}** |

   
  {% if note %}
    ### Note
    

{{ note }}

  {% endif %}
   

 
  

If you have any questions, please send an email to {{ shop.email }}

```

---

<div class="post-metadata">

**Author:** ![toooru](https://avatars.discourse-cdn.com/v4/letter/t/df788c/32.png) [@toooru](https://community.shopify.com/u/toooru)\
**Post date:** [December 15, 2021, 9:50am UTC](https://community.shopify.com/t/order-printer/83596/2 "2021-12-15T09:50:32Z")

</div>

以下のようにreplaceフィルターを使うことで可能ですのでご確認ください。

例）

```css
{{ gateway | replace: "shopify_payments", "クレジットカード決済" }}

```

複数の場合はパイプで区切ることで可能です。

例）

```css
{{ gateway | replace: "shopify_payments", "クレジットカード決済" | replace: "Cash on Delivery (COD)", "代金引換" }}

```

---

<div class="post-metadata">

**Author:** ![yuuka\_saito](https://avatars.discourse-cdn.com/v4/letter/y/bbce88/32.png) [@yuuka\_saito](https://community.shopify.com/u/yuuka_saito)\
**Post date:** [December 16, 2021, 2:46am UTC](https://community.shopify.com/t/order-printer/83596/3 "2021-12-16T02:46:09Z")

</div>

ありがとうございます！

こちらで対応できました。
