FROM CACHE - jp_header

サブスク注文をデフォルトに設定する方法

初心者1121
観光客
13 0 0

hopifyで販売する商品で単品購入と定期購入を用意したとします。

お客様が購入する際、デフォルトで、定期購入を選択した状態にする方法はありますか?

2件の返信2

junichiokamura
Community Manager
1200 280 506

ご自身でサブスクAPIを使って実装される場合は、購入のLiquidをそのようにすれば可能かと思いますが、アプリを使う場合はアプリの仕様によります。

日本のサブスクアプリであれば、要望を言えば対応してくれるかもしれません。

https://apps.shopify.com/collections/apps-for-japan?locale=ja

 

Senior Partner Solutions Engineer

camelmasa
Shopify Partner
83 10 27

JavaScript で指定する方法でもできるかと思いますが、Liquid でも出来ると思います。

シンプルな例ですが、特定のプラン名 (以下の例では "test") の場合 checked 要素を渡す方法などがあります。

{% for group in product.selling_plan_groups %}
<fieldset>
  <legend>{{ group.name}}</legend>
  {% for selling_plan in group.selling_plans %}
    {% if selling_plan.name == "test" %}
      <input type="radio" name="selling_plan" value="{{ selling_plan.id }}" checked >
    {% else %}
      <input type="radio" name="selling_plan" value="{{ selling_plan.id }}">
    {% endif %}
    {{ selling_plan.name }}
  {% endfor %}
</fieldset>
{% endfor %}