お客様へのメール内容の注文情報の返金済み合計額が取得できません。

Topic summary

Shopifyのフォローアップメール内で、注文の返金済み合計額が正しく取得できない問題が報告されています。

問題の詳細:

  • Order Printerでは返金額が正しく表示されるが、そのLiquidコードをフォローアップメールにコピペしても返金額が0になってしまう
  • {{ total_price | minus: refund_amount | money }} というコードを試しても、支払い総金額と返金額0の合計が表示される

提案された解決策:

  • Shopifyの標準テンプレート「注文の返金」に含まれるLiquidコード {{ total_price | minus: refund_amount | money }} の使用が提案された

現状:
質問者がOrder Printerの詳細なソースコードを共有したものの、フォローアップメールでの返金額表示問題は未解決のまま。追加の回答や解決策を待っている状態です。

Summarized with AI on November 20. AI used: claude-sonnet-4-5-20250929.

https://qiita.com/eijiSaito/items/175594e6490d63a3514f
こちらを参考に
order.total_net_amount で 返金済みの合計額を表示させたいのですが、お客様へのフォローアップメールの liquid 編集しても取得できず、0 になります。
どなたか 正しく 返金済みの最終合計額の表示方法をご教示いただけませんでしょうか。

Morimoto-Mantanさま

質問拝見いたしました。

「注文の返金」というテンプレートがShopifyには用意されていますが、こちらのテンプレートとは別に送信されたいということでしょうか?

上記テンプレートでは以下liquidで出力されていますので、お試しいただけますと幸いです。

{{ total_price | minus: amount | money }}

ご参考になりましたら幸いです。

私たちの励みにもなりますので、
お役に立てていればBest Answerボタンを押して頂ければ嬉しいです。

分からない点があれば、またいつでもご連絡ください。

フルバランス 渡邉

お返事ありがとうございます。

アドバイスいただいた コードを入れても 支払い総金額と返金額0 での合計が入ってしまいます。。。
order printer の方では、正しく表示されていまして、その内容を フォローアップメールの liquid にコピペで入れても 返金額が正しく反映されないのです。。。

こちらが、order printer のソースです。


  請求書 {{ order_name }}

![2022-12-13_16.33.10.png?v=1670917049|640x566](upload://u7IwrMtLNacLqNPw88s7PfC0kRB.png)

<strong>
AUSTERE JAPAN KOROMO</strong>

{{ shop.zip | upcase }} 
    {{ shop.city }}{{ shop.address }} 21-2

Email: shop@kyoto-koromo.com

---

### アイテム

      {% if show_line_item_taxes %}
      
      {% endif %}
      
    {% for line_item in line_items %}
      
        {% if show_line_item_taxes %}
        
        {% endif %}
        
    {% endfor %}
  

| 数量 | 作品 | 税 | 価格 |
| - | - | - | - |
| {{line_item.fulfillment.tracking_company}}{{ line_item.quantity }} x | **{{ line_item.title }}** | <br>          {% for tax_line in line_item.tax_lines %}<br>            {{ tax_line.price | money }} {{ tax_line.title | replace: 'CT','' }}<br><br>          {% endfor %}<br>         | <br>          {% if line_item.original_price != line_item.price %}<br>            ~~{{ line_item.original_price | money }}~~<br>          {% endif %}<br>          {{ line_item.price | money }}<br>         |

  {% comment %} 
{% if transactions.size > 1 %}
  ### 取引明細
  
      {% for transaction in transactions %}
        
      {% endfor %}
    

| 種類 | 金額 | 種別 | 状況 |
| - | - | - | - |
| {{ transaction.gateway | payment_method }} | {{ transaction.amount | money }} | {{ transaction.kind }} | {{ transaction.status }} |

{% endif %}
    {% endcomment %}
### 支払詳細

  {% for discount in discounts %}
  
  {% endfor %}
  
  {% if shipping_address %}
    
  {% endif %}
  
  {% if total_paid != total_price %}
  {% comment %} 
    
    {% endcomment %}
  {% endif %}
  

| 小計価格: | {{ subtotal_price | money }} |
| - | - |
| Includes discount "{{ discount.code }}" | {{ discount.savings | money }} |
| 税: | {{ tax_price | money }} |
| 配送料: | {{ shipping_price | money }} |
| **合計金額:** | **{{ total_price | money }}** |
| **支払総額:** | **{{ total_paid | money }}** |
| **未処理金額:** | **{{ total_price | minus: total_paid | money }}** |

{% if note %}
  ### メモ
  

{{ note }}

{% endif %}

{% if shipping_address %}

  ### 配送先詳細

  
    **{{ shipping_address.last_name }} {{ shipping_address.first_name }} 様**

    

        {{ shipping_address | format_address }}

          {% if shipping_address.phone != blank %}
            

            {{ shipping_address.phone }}
          {% endif %}
       
      

    {% if attributes %}
     
        
        {% for attribute in attributes %}
          
          
          {% if forloop.last == false %}{% endif %}
        {% endfor %}
        

| **{{ attribute | first }}:** | {{ attribute | last }} |
| - | - |

    

    {% endif %}
    

| **配送方法:** | {% if shipping_method %}{{ shipping_method.title }}{% else %}なし{% endif %} |
| - | - |

 

{% endif %}

{% if billing_address %}
  ### ご注文者様

  
    <strong>{{ billing_address.last_name }} {{ billing_address.first_name }} 様
    </strong>

     {{ billing_address | format_address }}

     {{ billing_address.phone }}
    ### 決済方法:{{ gateway | replace: "shopify_payments", "クレジットカード決済" | replace: "Cash on Delivery (COD)", "代金引換" | replace: "manual", "注文後調整" }}

  

{% endif %}


  
  
  
  
  
  

  
    <table>

      
        
           <table>

  
    
      
        <table>

          <tr>

            <td>

              
            

{{ custom_message }}

            

</td>

          </tr>

        </table>
      
    
  
</table>
          <table>

  
    
      

        <table>

          
            

              <table>

                <tr>

                  <td>

                    {%- if shop.email_logo_url %}
                      
                    {%- else %}
                      # 
                        {{ shop.name }}
                      
                    {%- endif %}
                  

</td>

                    <td>

                      
                        注文 {{ order_name }}
                      
                    

</td>

                </tr>

              </table>

            
          
        </table>

      
    
  
</table>

          <table>

  
    
      
        <table>

          
            
              
            ## {{ email_title }}
            

{{ email_body }}

         
            {% if order_status_url %}
              <table>

  <tr>

    <td>

 

</td>

  </tr>

  
    
      <table>

        <tr>

          <td>

注文を表示する

</td>

        </tr>

      </table>
      {% if shop.url %}
    <table>

      <tr>

        <td>

またはショップにアクセスする

</td>

      </tr>

    </table>
{% endif %}

    
  
</table>

            {% else %}
              {% if shop.url %}
    <table>

      
        
          <table>

            <tr>

              <td>

ショップにアクセスする

</td>

            </tr>

          </table>
        
      
    </table>
{% endif %}

            {% endif %}

            
          
        </table>
      
    
  
</table>

          {% assign gift_card_line_item = line_items | where: "gift_card" %}
          {% if gift_card_line_item.first %}
            <table>

  
    
      
        <table>

          <tr>

            <td>

              ### ギフトカード
            

</td>

          </tr>

        </table>
        <table>

          <tr>

            <td>

              
              

 ギフトカードの個別のメールが届きます。

            

</td>

          </tr>

        </table>
      
    
  
</table>
          {% endif %}

          
              <table>

  <tr>

    <td>

      

        
      
    

</td>

  </tr>

</table>
         
  
  

それで以下が お客様へ連絡メールのソースです。
いただいた内容のソースを入れても正しく反映されなかったので、一旦消しております。
現時点で入っているソースが悪さをしているような状態になりますでしょうか。
お手数ですが、宜しくお願いいたします。