Liquid、JavaScriptなどに関する質問
設定 > 配送と配達 > 明細表 > 明細表のテンプレートにて、明細票を作成しています。
後述のように組んでいるのですが、「小計」が 価格 × 数量の計算結果にならず、単体価格が表示されてしまいます。(添付画像の表を参照ください)
購入した数量は表示されているのに、final_line_priceを使っても表示されないのはなぜでしょうか?
また、「商品金額合計」や「合計金額」も正しく表示されないのは、なぜでしょうか?
間違っている部分などを教えていただければ幸いです。よろしくお願いします。
{% 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>
解決済! ベストソリューションを見る。
成功
単価 × 数量 で小計を算出してみてはどうでしょうか。
{% assign a = final_price %}
{% assign b = line_item.quantity %}
小計 {{ a | times:b | money }}
成功
単価 × 数量 で小計を算出してみてはどうでしょうか。
{% assign a = final_price %}
{% assign b = line_item.quantity %}
小計 {{ a | times:b | money }}
Shopify アカデミーの学習パスと認定スキルバッジExpanding Your Shopify Business Internationallyを活用して、国際的にビジネ...
By Shopify Feb 7, 2025Shopify アカデミーの学習パスB2B on Shopify:立ち上げとカスタマイズで卸売販売に進出しましょう。これら3つの無料コースは、ShopifyストアでB2B機能...
By Shopify Jan 31, 2025サポートの選択肢が増えていく中、最適となる選択の判断が難しくなっているかと存じます。今回は問題の解決に最適となるサポートの選択方法を、紹介させて頂きます。 選択肢のご紹介...
By Mirai Oct 6, 2024