FROM CACHE - jp_header
このコミュニティはピアツーピアサポートに移行しました。Shopify サポートは今後、このコミュニティへのサービスを提供いたしません。これからもぜひ、他のマーチャントやパートナーとつながり、サポートし合い、経験を共有してください。 当社の行動規範に違反する行動や削除を希望するコンテンツがありましたら、引き続きご報告ください

複数個購入時の代金表示について

解決済

複数個購入時の代金表示について

irodori
観光客
4 0 0

設定 > 配送と配達 > 明細表 > 明細表のテンプレートにて、明細票を作成しています。

後述のように組んでいるのですが、「小計」が 価格 × 数量の計算結果にならず、単体価格が表示されてしまいます。(添付画像の表を参照ください)

購入した数量は表示されているのに、final_line_priceを使っても表示されないのはなぜでしょうか?

また、「商品金額合計」や「合計金額」も正しく表示されないのは、なぜでしょうか?

間違っている部分などを教えていただければ幸いです。よろしくお願いします。

スクリーンショット 2020-12-09 17.08.16.png

 

 

{% assign final_price = nil %}
        {% assign final_line_price = nil %}
        {% for item in order.line_items %}
          {% assign final_price = item.final_price %}
          {% assign final_line_price = item.final_line_price %}
        {% endfor %}

        {% for line_item in line_items_in_shipment %}
          <tr>
            <td>
              {% if line_item.image != blank %}
                <img src="{{ line_item.image | img_url: '100x100' }}" alt="" style="width: {{ desired_image_size }}px; height: {{ desired_image_size }}px;">
              {% endif %}
            </td>
            <td>{{ line_item.title }}</td>
            <td>
              {% if final_price %}
                {{ final_price | money }}
              {% endif %}</td>
            <td>{{ line_item.quantity }}</td>
            <td>
              {% if final_line_price %}
                {{ final_line_price | money }}
              {% endif %}</td>
          </tr>
        {% endfor %}



<div class="table_price">
      <table>
        <tbody>
          <tbody>
            <tr>
              <th>商品金額合計</th>
              <td>
                {{ order.line_items_subtotal_price | money }}
              </td>
            </tr>
            <tr>
              <th>送料</th>
              <td>{{ order.shipping_price | money }}</td>
            </tr>
            <tr>
              <th>合計金額</th>
              <td>{{ order.total_price | money  }}</td>
            </tr>
            
          </tbody>
        </tbody>
      </table>

 

1 件の受理された解決策

_osamu_iwasaki_
Shopify Partner
189 47 195

成功

単価 × 数量 で小計を算出してみてはどうでしょうか。

{% assign a = final_price %}
{% assign b = line_item.quantity %}

小計 {{ a | times:b | money }}

 

元の投稿で解決策を見る

2件の返信2

_osamu_iwasaki_
Shopify Partner
189 47 195

成功

単価 × 数量 で小計を算出してみてはどうでしょうか。

{% assign a = final_price %}
{% assign b = line_item.quantity %}

小計 {{ a | times:b | money }}

 

irodori
観光客
4 0 0

ありがとうございます!