会員ログイン/会員登録画面
会員がログインする画面です。
ログインフォームと会員登録フォーム一体型を採用しているショップが多いですが、それぞれを別画面に配置できます。
会員規約の文章を置くことも可能です。 (ハードコーディングになります。)
ショップのパス
ドメイン/shop/customers/sign_in
テーマ管理のファイルパス
ec_force/shop/customers/sessions/new.html.liquid
ec_force/shop/customers/sessions/new.html+smartphone.liquid
JS タグ
{{ 'shop/customers/sessions' | javascript_include_tag }}
必要なコンポーネント
{{ 'shop/customers/sessions' | javascript_include_tag }}
<div id="customers-sessions-sign-in-view">
<!-- ログインフォームの記述 -->
{% unless auth_infra and auth_infra.login_only_auth_infra == true %}
<form action="/shop/customers/sign_in" accept-charset="UTF-8" method="post">
{{ 'notice' | flash: 'alert alert-success', 'text' }}
{{ 'alert' | flash: 'alert alert-danger', 'text' }}
{{ 'error' | flash: 'alert alert-danger', 'text' }}
<!-- メールアドレス -->
<label for="customer_email_si">メールアドレス</label>
<input class="validate[required,custom[email]]" type="text" name="customer[email]" autocomplete="email" id="customer_email_si" />
<!-- パスワード -->
<label for="customer_password_si">パスワード</label>
<input type="password" class="validate[required]" name="customer[password]" autocomplete="current-password" id="customer_password_si" />
<!-- ログイン状態保持 -->
<label class="check-inline">
<input name="customer[remember_me]" type="hidden" value="0">
<input type="checkbox" value="1" name="customer[remember_me]" id="customer_remember_me">
<span>ログイン状態を保持する</span>
</label>
<!-- ログイン元を取得 -->
<input type="hidden" name="sign_in_route" value="shop_customers">
<!-- 送信ボタン -->
<input type="submit" name="commit" value="ログイン" />
<a href='/shop/customers/password/new'>パスワードを設定されていない方、お忘れの方はこちら</a>
</form>
{% if line_settings['display_btn'] == '1' and encrypted_line_id == nil %}
<!-- LINE ID 説明ポップアップ -->
{{ line_settings['information_context'] }}
<!-- LINE ID 連携ボタン(クラス) -->
<a class="line-token-set-btn" href="#">LINEでログイン</a>
{% endif %}
{% endunless %}
<!-- ログインフォームの記述ここまで -->
<!-- 認証基盤でのログインボタン -->
{% if auth_infra and auth_infra_regist == nil %}
<a class="auth-infra-token-set-btn" href="#">認証基盤でログイン</a>
{% endif %}
<!-- 会員登録フォームの記述(任意)-->
{% 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 %}
<div>
{% for error_message in customer.error_messages %}
<p>{{ error_message }}</p>
{% endfor %}
</div>
{% endif %}
<!-- お名前 -->
<label for="customer_billing_address_attributes_name01">お名前</label>
{% if shop_form_settings['name_1_field'] %}
<input class="validate[required]" type="text" value="" name="customer[billing_address_attributes][name01]" autocomplete="name" id="customer_billing_address_attributes_name01" />
{% else %}
<input class="validate[required]" type="text" value="" name="customer[billing_address_attributes][name01]" autocomplete="family-name" id="customer_billing_address_attributes_name01" />
<input class="validate[required]" type="text" value="" 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="" name="customer[billing_address_attributes][kana01]" id="customer_billing_address_attributes_kana01" />
{% else %}
<input class="validate[required,custom[katakana]]" type="text" value="" name="customer[billing_address_attributes][kana01]" id="customer_billing_address_attributes_kana01" />
<input class="validate[required,custom[katakana]]" type="text" value="" 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="" 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="" 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="" 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" name="customer[billing_address_attributes][addr01]" id="customer_billing_address_attributes_addr01" />
<input class="validate[required]" type="text" name="customer[billing_address_attributes][addr02]" id="customer_billing_address_attributes_addr02" />
{% if shop_form_settings['addr03'] %}
<input type="text" 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="" 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="" 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="" 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="" 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="" name="customer[billing_address_attributes][fax01]" id="customer_billing_address_attributes_fax01" maxlength='12' />
{% else %}
<input type="text" value="" name="customer[billing_address_attributes][fax01]" id="customer_billing_address_attributes_fax01" maxlength='5' />
<span>−</span>
<input type="text" value="" name="customer[billing_address_attributes][fax02]" id="customer_billing_address_attributes_fax02" maxlength='4' />
<span>−</span>
<input type="text" value="" 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="" 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="js-email-autocomplete validate[required,custom[email]] for_password_validate" type="text" 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 %}
<!-- パスワード -->
<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 %}
<!-- 連携用顧客番号 -->
{% 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 %}
<!-- 利用規約 -->
<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>
<!-- 送信ボタン -->
<input type="submit" name="commit" value="保存" />
<!-- TOPに戻るボタン(任意) -->
<a href="/shop">戻る</a>
</form>
{% endunless %}
<!-- 会員登録フォーム(任意)ここまで -->
</div>
画面イメージ
※こちらは、上記で紹介しているコンポーネントのコードにデフォルトデザインをCSSであてたイメージになります。コンポーネントのコードのみだと、このような表示にはなりませんのでご注意ください。