Liquid、JavaScriptなどに関する質問
dawnのテーマを使用しております。
main-product.liquid内にて、以下のコード(抜粋)のように、商品の熨斗・名入れ有無・名入れ文字・備考欄と4つのプロパティを追加しています。
通知メールの商品下にそのプロパティ内容を挿入したいのですが、
どのように表記すべきか、お分かりになる方がいらっしゃれば教えていただけますと幸いです。
よろしくお願い申し上げます。
■main-product.liquid
{%- when 'noshi' -%}
{% assign types = block.settings.select | split: "," %}
<div class="noshi__contents product-width wrappingOption">
<div class="noshi__select-feild">
<label for="type">{{ block.settings.title1 }}</label>
<select id="type" name="properties[熨斗紙]" form="product-form-{{ section.id }}">
{% for type in types limit:1 %}
<option value="{{ type }}" selected="selected">{{ type }}</option>
{% endfor %}
{% for type in types offset:1 %}
<option value="{{ type }}">{{ type }}</option>
{% endfor %}
</select>
</div>
{% if block.settings.memo-enable %}
<input type="hidden" id="js-memo-val" value="{{ block.settings.memo }}">
<div id="js-memo" class="noshi__select-feild">
<input id="memo" type="text" name="properties[その他]" form="product-form-{{ section.id }}" placeholder="その他の詳細を入力ください">
</div>
{% endif %}
{% if block.settings.naire-enable %}
<input type="hidden" id="js-except" value="{{ block.settings.except }}">
<div id="js-nairi" class="noshi__select-feild">
<label>名入れ</label>
<select id="naire-availability-select" name="properties[名入れ有無]" form="product-form-{{ section.id }}" onchange="toggleNaireInput()">
<option value="なし" selected="selected">なし</option>
<option value="あり">あり</option>
</select>
<input type="hidden" id="naire-availability-select" value="{{ block.settings.memo }}">
<div class="noshi__select-feild" style="display: none;" id="naire-input">
<input id="naire" type="text" name="properties[名入れ文字]" form="product-form-{{ section.id }}" placeholder="名入れの文字を入力してください">
</div>
</div>
{% endif %}
{% if block.settings.other-request-enable %}
<input type="hidden" value="{{ block.settings.except }}">
<div class="noshi__select-feild">
<label for="other-request">{{ block.settings.title5 }}</label>
<textarea id="other-request" name="properties[備考欄]" form="product-form-{{ section.id }}" rows="3" placeholder="ご要望はこちらにご入力ください"></textarea>
</div>
</div>
{% endif %}
</div>
{%- endcase -%}
■メール
{% if line.product.title %}
{% assign line_title = line.product.title | replace: '<br>', ' ' %}
{% else %}
{% assign line_title = line.title | replace: '<br>', ' ' %}
{% endif %}
解決済! ベストソリューションを見る。
成功
通知メールの商品下にそのプロパティ内容を挿入したい件ですが、
通知メール(注文の確認 ※デフォルトテンプレートの場合)の下記コードの下に
<span class="order-list__item-title">{{ line_title }} × {{ line_display }}</span><br/>
下記コードを追加いただければ表示可能かと思います。
{% if line.properties %}
{% for propertie in line.properties %}
<span>{{ propertie[0] }}:{{ propertie[1] }}</span><br>
{% endfor %}
{% endif %}
ご参考まで。
(キュー小坂)
成功
通知メールの商品下にそのプロパティ内容を挿入したい件ですが、
通知メール(注文の確認 ※デフォルトテンプレートの場合)の下記コードの下に
<span class="order-list__item-title">{{ line_title }} × {{ line_display }}</span><br/>
下記コードを追加いただければ表示可能かと思います。
{% if line.properties %}
{% for propertie in line.properties %}
<span>{{ propertie[0] }}:{{ propertie[1] }}</span><br>
{% endfor %}
{% endif %}
ご参考まで。
(キュー小坂)
小坂様
ご回答ありがとうございます。いただいたコードで無事出力されました。大変助かりました。ありがとうございました。
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