テーマ仕様書
shop
会員登録・ログイン
会員登録
会員登録画面

会員登録画面

新規会員登録する画面です。
会員ログインフォームに会員登録画面のコンポーネントを記述し、ログインフォームと会員登録フォームの一体型にできます。
また、会員規約の文章を設置できます。 (ハードコーディングになります。)

ショップのパス

ドメイン/shop/customers/sign_up

テーマ管理のファイルパス

ec_force/shop/customers/registrations/new.html.liquid
ec_force/shop/customers/registrations/new.html+smartphone.liquid

JS タグ

{{ 'shop/customers/registrations' | javascript_include_tag }}

必要なコンポーネント

※コメントアウトで任意とあるもの以外はシステム上必要なコンポーネントとなります。

{{ 'shop/customers/registrations' | javascript_include_tag }}
 
<!-- 会員登録画面コンテナ -->
<div id="customers-registrations-sign-up-view">
  <!-- 会員登録フォームの記述 -->
{% unless auth_infra and auth_infra.login_only_auth_infra == true and auth_infra_regist == nil %}
  <form action="/shop/customers" accept-charset="UTF-8" method="post">
    {% if customer.error_messages != empty %}
        {% for error_message in customer.error_messages %}
          {{ error_message }}
        {% endfor %}
    {% endif %}
 
    <!-- お名前 -->
    <label for="customer_billing_address_attributes_name01">お名前</label>
    {% if shop_form_settings['name_1_field'] %}
      <input class="validate[required]" type="text" value="{{ customer.billing_address.name01 }}" name="customer[billing_address_attributes][name01]" autocomplete="name" id="customer_billing_address_attributes_name01" />
    {% else %}
      <input class="validate[required]" type="text" value="{{ customer.billing_address.name01 }}" name="customer[billing_address_attributes][name01]" autocomplete="family-name" id="customer_billing_address_attributes_name01" />
      <input class="validate[required]" type="text" value="{{ customer.billing_address.name02 }}" name="customer[billing_address_attributes][name02]" autocomplete="given-name" id="customer_billing_address_attributes_name02" />
    {% endif %}
 
    <!-- フリガナ -->
    <label for="customer_billing_address_attributes_kana01">フリガナ</label>
    {% if shop_form_settings['kana_1_field'] %}
        <input class="validate[required,custom[katakana]]" type="text" value="{{ customer.billing_address.kana01 }}" name="customer[billing_address_attributes][kana01]" id="customer_billing_address_attributes_kana01" />
    {% else %}
        <input class="validate[required,custom[katakana]]" type="text" value="{{ customer.billing_address.kana01 }}" name="customer[billing_address_attributes][kana01]" id="customer_billing_address_attributes_kana01" />
        <input class="validate[required,custom[katakana]]" type="text" value="{{ customer.billing_address.kana02 }}" name="customer[billing_address_attributes][kana02]" id="customer_billing_address_attributes_kana02" />
    {% endif %}
 
    <!-- 郵便番号 -->
    <label for="customer_billing_address_attributes_zip01">郵便番号</label>
    {% if shop_form_settings['zip_1_field'] %}
      <span>〒</span>
      <input class="validate[required,custom[integer],minSize[7]]" type="tel" value={{ customer.billing_address.zip01 }}" name="customer[billing_address_attributes][zip01]" autocomplete="postal-code" id="customer_billing_address_attributes_zip01" maxlength='7' />
    {% else %}
      <span>〒</span>
      <input class="validate[required,custom[integer],minSize[3]]" type="tel" value="{{ customer.billing_address.zip01 }}" name="customer[billing_address_attributes][zip01]" autocomplete="postal-code" id="customer_billing_address_attributes_zip01" maxlength='3' />
      <span>−</span>
      <input class="validate[required,custom[integer],minSize[4]]" type="tel" value="{{ customer.billing_address.zip02 }}" name="customer[billing_address_attributes][zip02]" autocomplete="none" id="customer_billing_address_attributes_zip02" maxlength='4' />
    {% endif %}
 
    <!-- 都道府県 -->
    <label for="customer_billing_address_attributes_prefecture_name">都道府県</label>
    <select class="validate[required]" name="customer[billing_address_attributes][prefecture_name]" id="customer_billing_address_attributes_prefecture_name">
      <option value="">選択してください</option>
      {% for prefecture in prefectures %}
        <option value='{{ prefecture.name }}' {% if customer.billing_address.prefecture.id == prefecture.id %}selected{% endif %}>{{ prefecture.name }}</option>
      {% endfor %}
    </select>
 
    <!-- 住所 -->
    <label for="customer_billing_address_attributes_addr01">住所</label>
    <input class="validate[required]" type="text" value="{{ customer.billing_address.addr01 }}" name="customer[billing_address_attributes][addr01]" id="customer_billing_address_attributes_addr01" />
    <input class="validate[required]" type="text" value="{{ customer.billing_address.addr02 }}" name="customer[billing_address_attributes][addr02]" id="customer_billing_address_attributes_addr02" />
    {% if shop_form_settings['addr03'] %}
      <input type="text" value="{{ customer.billing_address.addr03 }}" name="customer[billing_address_attributes][addr03]" id="customer_billing_address_attributes_addr03" />
    {% endif %}
 
    <!-- 電話番号 -->
    <label for="customer_billing_address_attributes_tel01">電話番号</label>
    {% if shop_form_settings['tel_1_field'] %}
      <input class="validate[required,custom[integer]]" type="text" value="{{ customer.billing_address.tel01 }}" name="customer[billing_address_attributes][tel01]" autocomplete="tel" id="customer_billing_address_attributes_tel01" maxlength='12' />
    {% else %}
      <input class="validate[required,custom[integer]]" type="text" value="{{ customer.billing_address.tel01 }}" name="customer[billing_address_attributes][tel01]" autocomplete="none" id="customer_billing_address_attributes_tel01" maxlength='5' />
      <span>−</span>
      <input class="validate[required,custom[integer]]" type="text" value="{{ customer.billing_address.tel02 }}" name="customer[billing_address_attributes][tel02]" autocomplete="none" id="customer_billing_address_attributes_tel02" maxlength='4' />
      <span>−</span>
      <input class="validate[required,custom[integer]]" type="text" value="{{ customer.billing_address.tel03 }}" name="customer[billing_address_attributes][tel03]" autocomplete="none" id="customer_billing_address_attributes_tel03" maxlength='4' />
    {% endif %}
    {% unless shop_form_settings['email'] %}
      <span>※ご注文・発送に関するご連絡用にSMS受信可能な携帯電話番号をご入力ください。</span>
    {% endunless %}
 
    <!-- FAX番号(任意) -->
    {% if shop_form_settings['fax'] %}
      <label for="customer_billing_address_attributes_fax01">FAX番号</label>
      {% if shop_form_settings['fax_1_field'] %}
        <input type="text" value="{{ customer.billing_address.fax01 }}" name="customer[billing_address_attributes][fax01]" id="customer_billing_address_attributes_fax01" maxlength='12' />
      {% else %}
        <input type="text" value="{{ customer.billing_address.fax01 }}" name="customer[billing_address_attributes][fax01]" id="customer_billing_address_attributes_fax01" maxlength='5' />
        <span>−</span>
        <input type="text" value="{{ customer.billing_address.fax02 }}" name="customer[billing_address_attributes][fax02]" id="customer_billing_address_attributes_fax02" maxlength='4' />
        <span>−</span>
        <input type="text" value="{{ customer.billing_address.fax03 }}" name="customer[billing_address_attributes][fax03]" id="customer_billing_address_attributes_fax03" maxlength='4' />
      {% endif %}
    {% endif %}
 
    <!-- 会社名(任意) -->
    {% if shop_form_settings['company'] %}
      <label for="customer_billing_address_attributes_company_name">会社名</label>
      <input type="text" value="{{ customer.billing_address.company_name }}" name="customer[billing_address_attributes][company_name]" autocomplete="organization" id="customer_billing_address_attributes_company_name">
    {% endif %}
 
    <!-- メールアドレス -->
    {% if shop_form_settings['email'] %}
      <label for="customer_email">メールアドレス</label>
      <input class="validate[required,custom[email]] for_password_validate" type="text" value="{{ customer.email }}" name="customer[email]" autocomplete="email" id="customer_email" />
    {% endif %}
 
    <!-- 性別 -->
    {% if shop_form_settings['sex'] %}
      <label for="customer_sex_id">性別</label>
      <select name="customer[sex_id]" id="customer_sex_id">
        <option value="">選択してください</option>
        {% for sex in sexes %}
          <option value='{{ sex.id }}' {% if customer.sex.id == sex.id %}selected{% endif %}>{{ sex.name }}</option>
        {% endfor %}
      </select>
    {% endif %}
 
    <!-- 職業 -->
    {% if shop_form_settings["job"] %}
      <label for="customer_job_id">職業</label>
      <select name="customer[job_id]" id="customer_job_id">
        <option value="">選択してください</option>
        {% for job in jobs %}
          <option value='{{ job.id }}' {% if customer.job.id == job.id %}selected{% endif %}>{{ job.name }}</option>
        {% endfor %}
      </select>
    {% endif %}
 
    <!-- 生年月日 -->
    {% if shop_form_settings["birth"] %}
      <label  for="customer_birth">生年月日</label>
      <select id="customer_birth_1i" name="customer[birth(1i)]" autocomplete="bday-year" class="validate[condRequired[customer_birth_2i,customer_birth_3i]]">
        {% if birth_year_default_value == 0 %}
          <option value="">----</option>
        {% endif %}
        {% assign now_year = "now" | date: "%Y" %}
        {% assign past_100_years = "now" | date: "%Y" | minus: 100 %}
        {% for y in (past_100_years..now_year) %}
          {% if birth_year_default_value == y %}
            {% if customer.birth_year == nil %}
              <option value="" selected="true">----</option>
            {% else %}
              <option value="">----</option>
            {% endif %}
          {% endif %}
          <option value='{{ y }}' {% if customer.birth_year == y %}selected{% endif %}>{{ y }}</option>
        {% endfor %}
      </select>
      <span>年</span>
      <select id="customer_birth_2i" name="customer[birth(2i)]" autocomplete="bday-month" class="validate[condRequired[customer_birth_1i,customer_birth_3i]]">
        <option value="">--</option>
        {% for m in (1..12) %}
          <option value='{{ m }}'{% if customer.birth_month == m %}selected{% endif %}>{{ m }}</option>
        {% endfor %}
      </select>
      <span>月</span>
      <select id="customer_birth_3i" name="customer[birth(3i)]" autocomplete="bday-day" class="validate[condRequired[customer_birth_1i,customer_birth_2i]]">
        <option value="">--</option>
        {% for d in (1..31) %}
          <option value='{{ d }}'{% if customer.birth_day == d %}selected{% endif %}>{{ d }}</option>
        {% endfor %}
      </select>
      <span>日</span>
    {% endif %}
 
    {% unless auth_infra and auth_infra.login_only_auth_infra == true %}
      <!-- パスワード -->
      <label for="customer_password">パスワード</label>
      <input class="validate[required,custom[validatePasswordForCustomerByAdminSetting]]" placeholder="半角英数字8文字以上" type="password" name="customer[password]" id="customer_password" />
 
      <!-- パスワード(確認) -->
      {% if shop_form_settings["password_confirmation"] %}
        <label for="customer_password_confirmation">パスワード(確認)</label>
        <input class="validate[required,minSize[8],equals[customer_password]]" placeholder="半角英数字8文字以上" type="password" name="customer[password_confirmation]" id="customer_password_confirmation" />
      {% endif %}
    {% endunless %}
 
    <!-- 連携用顧客番号 -->
    {% if shop_form_settings['link_number'] %}
      <label>{{ shop_form_settings['link_number_label'] }}</label>
      <label for='check_toggle_text'>
        <input id="check_toggle_text" name="customer[link_number]" type="checkbox">
        {{ shop_form_settings['link_number_checkbox_label'] }}
        <div class="toggle_text" style="display: none">
          {{ shop_form_settings['link_number_description'] }}
          <input name="customer[link_number]" placeholder="{{shop_form_settings['link_number_placeholder']}}">
        </div>
      </label>
    {% endif %}
 
    <!-- オプトイン -->
    {% if shop_form_settings['optin_signup'] %}
      <label class='checkbox-inline' for='optin'>
        <input {% if shop_form_settings['optin_default_signup'] %}checked{% endif %} class='u-color__border--input' id="optin" name="customer[optin]" type="checkbox">
        {{ shop_form_settings['optin_text'] }}
      </label>
    {% else %}
      <input value="{% if shop_form_settings['optin_default_signup'] %}1{% else %}0{% endif %}" name="customer[optin]" type="hidden">
    {% endif %}
 
    <!-- 利用規約 -->
    {% unless auth_infra and auth_infra.login_only_auth_infra == true %}
      <label class='checkbox-inline' for='agree'>
        <input id='agree' {% if shop_form_settings['terms'] %}checked{% endif %} class='validate[required]' data-prompt-position='topLeft' data-errormessage='会員登録には、各種規約に同意していただく必要がございます。' name='agree' type='checkbox'>
        {{ shop_form_settings['customer_term_text'] }}
      </label>
    {% endunless %}
 
    <!-- 送信ボタン -->
    <input type="submit" name="commit" value="保存" />
 
    <!-- TOPに戻るボタン(任意) -->
    <a href="/shop">戻る</a>
 
  </form>
{% endunless %}
 
</div>

画面イメージ

※こちらは、上記で紹介しているコンポーネントのコードにデフォルトデザインをCSSであてたイメージになります。コンポーネントのコードのみだと、このような表示にはなりませんのでご注意ください。