SENGINEのインストールを完了させるためには、サブスクリプションテーマのインストール対応が必要となります。Headless でShopifyの外部からサイトを構築されている場合は、別途対応が必要となりますので、ページ下部よりリクエストをお送りください。

また、一部のテーマや独自開発のテーマでは下記マニュアルが当てはまらないケースもありますので、その場合もリクエストをお送りいただければご案内差し上げます。

目次

STEP1. 商品詳細/商品フォームにサブスクリプションテーマをインストールSTEP2. アカウントページにテーマをインストール

STEP1. 商品詳細/商品フォームにサブスクリプションテーマをインストール

  1. 価格部分(2のコードより前である必要があります。)を以下で置換します
{% assign current_variant = product.selected_or_first_available_variant %}
{% assign default_selling_plan_group = product.selling_plan_groups | first %}
{% assign default_selling_plan = default_selling_plan_group.selling_plans | first %}
{% assign current_selling_plan_allocation = current_variant.selected_selling_plan_allocation %}
{% if current_selling_plan_allocation == nil and current_variant.requires_selling_plan %}
{% assign current_selling_plan_allocation = current_variant.selling_plan_allocations | first %}
{% endif %}
{% assign offer = current_selling_plan_allocation | default: current_variant %}

{% if offer.compare_at_price > offer.price %}
<s>{{ offer.compare_at_price | money }}</s>
<span>{% if offer.selling_plan %}定期購入{% else %}セール{% endif %}</span>
{% endif %}
  1. {% form 'product', product %} の直下に以下を配置します。

{% if default_selling_plan_group %}
{% unless product.requires_selling_plan %}
<label><input type="radio" name="selling_plan" value=""> 1回のみのご購入</label>
{% endunless %}

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

※サブスクリプション対応にしていない商品の場合は表記が変わりません。

STEP2. アカウントページにテーマをインストール

以下のコードをアカウントページのサブスクリプションの更新を行う場所に設置してください。通常の設定だと、メールを送る画面が、liquid上にサブスクリプション一覧を掲載する設定の場合はサブスクリプション一覧が表示されます。

<div id="sengine_myaccount"></div>