How can I add checkbox to my register form

Solved

How can I add checkbox to my register form

Aleksander22
Trailblazer
168 0 58

Hello,

I need help with adding check box like here to my register form 

IMG_1978.jpeg

 And I here how my form looks like 

IMG_1979.jpeg

Accepted Solutions (2)

BSSCommerce-B2B
Shopify Partner
1739 522 584

This is an accepted solution.

@Aleksander22 , Add this code before this postion i've marked here in main-register.liquid file

BSSCommerceB2B_0-1727519950064.png

Here is your code:  

 

<div style="display: flex; gap: 10px; align-items: start; margin: 2rem 0 0;">
      <input
        type="checkbox"
        name="customer[accepts_marketing]"
        value="true"
        id="marketing"
        style="margin: 0.5rem 0 0 0"
      >
      <label for="marketing" style="text-align: start; font-size: 14px">
        Tick here to receive emails about our products, apps, sales, exclusive content and more. View our
        <a href="/policies/terms-of-service" style="font-weight: bold">Privacy Policy.</a>
      </label>
    </div>

 

 

B2B Wholesale Solution: Streamline your B2B operation with advanced features like wholesale registration forms, custom pricing.


B2B Portal, Quote, Net 30: Speed up purchasing and streamline your quotation process with advanced features like quick order, request for quote.


B2B Lock Password Protect: Easily control access to pages, products, and pricing with robust features.


BSS Commerce - Full-service eCommerce Agency I Use Shopify for 1$ in the first month now

View solution in original post

BSSCommerce-B2B
Shopify Partner
1739 522 584

This is an accepted solution.

@Aleksander22, Change all the code in main-register.liquid file like this

{{ 'customer.css' | asset_url | stylesheet_tag }}

{%- style -%}
  .section-{{ section.id }}-padding {
    padding-top: {{ section.settings.padding_top | times: 0.75 | round: 0 }}px;
    padding-bottom: {{ section.settings.padding_bottom | times: 0.75 | round: 0 }}px;
  }

  @media screen and (min-width: 750px) {
    .section-{{ section.id }}-padding {
      padding-top: {{ section.settings.padding_top }}px;
      padding-bottom: {{ section.settings.padding_bottom }}px;
    }
  }
{%- endstyle -%}

<div class="customer register section-{{ section.id }}-padding">
  <h1>
    {% comment %}
      {{ 'customer.register.title' | t }}
    {% endcomment %}
    MY GLOVYZONE
  </h1>
  {% if section.settings.registration_logo %}
    <img
      class="registration-logo"
      src="{{ section.settings.registration_logo | img_url: 'original' }}"
      alt="Registration Logo"
      height="{{ section.settings.registration_logo_size}}"
    >
  {% endif %}
  {%- form 'create_customer', novalidate: 'novalidate' -%}
    {%- if form.errors -%}
      <h2 class="form__message" tabindex="-1" autofocus>
        <span class="svg-wrapper">
          {{- 'icon-error.svg' | inline_asset_content -}}
        </span>
        {{ 'templates.contact.form.error_heading' | t }}
      </h2>
      <ul>
        {%- for field in form.errors -%}
          <li>
            {%- if field == 'form' -%}
              {{ form.errors.messages[field] }}
            {%- else -%}
              <a href="#RegisterForm-{{ field }}">
                {{ form.errors.translated_fields[field] | capitalize }}
                {{ form.errors.messages[field] }}
              </a>
            {%- endif -%}
          </li>
        {%- endfor -%}
      </ul>
    {%- endif -%}
    <div class="field">
      <input
        type="text"
        name="customer[first_name]"
        id="RegisterForm-FirstName"
        {% if form.first_name %}
          value="{{ form.first_name }}"
        {% endif %}
        autocomplete="given-name"
        placeholder="{{ 'customer.register.first_name' | t }}"
      >
      <label for="RegisterForm-FirstName">
        {{ 'customer.register.first_name' | t }}
      </label>
    </div>
    <div class="field">
      <input
        type="text"
        name="customer[last_name]"
        id="RegisterForm-LastName"
        {% if form.last_name %}
          value="{{ form.last_name }}"
        {% endif %}
        autocomplete="family-name"
        placeholder="{{ 'customer.register.last_name' | t }}"
      >
      <label for="RegisterForm-LastName">
        {{ 'customer.register.last_name' | t }}
      </label>
    </div>
    <div class="field">
      <input
        type="email"
        name="customer[email]"
        id="RegisterForm-email"
        {% if form.email %}
          value="{{ form.email }}"
        {% endif %}
        spellcheck="false"
        autocapitalize="off"
        autocomplete="email"
        aria-required="true"
        {% if form.errors contains 'email' %}
          aria-invalid="true"
          aria-describedby="RegisterForm-email-error"
        {% endif %}
        placeholder="{{ 'customer.register.email' | t }}"
      >
      <label for="RegisterForm-email">
        {{ 'customer.register.email' | t }}
      </label>
    </div>
    {%- if form.errors contains 'email' -%}
      <span id="RegisterForm-email-error" class="form__message">
        <span class="svg-wrapper">
          {{- 'icon-error.svg' | inline_asset_content -}}
        </span>
        {{ form.errors.translated_fields.email | capitalize }}
        {{ form.errors.messages.email }}.
      </span>
    {%- endif -%}
    <div class="field">
      <input
        type="password"
        name="customer[password]"
        id="RegisterForm-password"
        aria-required="true"
        {% if form.errors contains 'password' %}
          aria-invalid="true"
          aria-describedby="RegisterForm-password-error"
        {% endif %}
        placeholder="{{ 'customer.register.password' | t }}"
      >
      <label for="RegisterForm-password">
        {{ 'customer.register.password' | t }}
      </label>
    </div>
    {%- if form.errors contains 'password' -%}
      <span id="RegisterForm-password-error" class="form__message">
        <span class="svg-wrapper">
          {{- 'icon-error.svg' | inline_asset_content -}}
        </span>
        {{ form.errors.translated_fields.password | capitalize }}
        {{ form.errors.messages.password }}.
      </span>
    {%- endif -%}
    <div style="display: flex; gap: 10px; align-items: start; margin: 2rem 0 0;">
      <input
        type="checkbox"
        name="customer[accepts_marketing]"
        value="true"
        id="marketing"
        style="margin: 0.5rem 0 0 0"
      >
      <label for="marketing" style="text-align: start; font-size: 14px">
        Tick here to receive emails about our products, apps, sales, exclusive content and more. View our
        <a href="/policies/terms-of-service" style="font-weight: bold">Privacy Policy.</a>
      </label>
    </div>
    <button>
      {{ 'customer.register.submit' | t }}
    </button>
  {%- endform -%}
</div>

{% schema %}
{
  "name": "t:sections.main-register.name",
  "settings": [
    {
      "type": "header",
      "content": "t:sections.all.padding.section_padding_heading"
    },
    {
      "type": "range",
      "id": "padding_top",
      "min": 0,
      "max": 100,
      "step": 4,
      "unit": "px",
      "label": "t:sections.all.padding.padding_top",
      "default": 36
    },
    {
      "type": "range",
      "id": "padding_bottom",
      "min": 0,
      "max": 100,
      "step": 4,
      "unit": "px",
      "label": "t:sections.all.padding.padding_bottom",
      "default": 36
    },{
      "type": "image_picker",
      "id": "registration_logo",
      "label": "Registration Logo",
    },
    {
      "type": "range",
      "id": "registration_logo_size",
      "label": "Registration Logo Size",
      "default": 50,
      "min": 20,
      "max": 100,
      "step": 5,
      "unit": "px"
    }
  ]
}
{% endschema %}

And then you have 2 option to choose the image and size

BSSCommerceB2B_0-1727522089754.png

Hope it helps you 😊

B2B Wholesale Solution: Streamline your B2B operation with advanced features like wholesale registration forms, custom pricing.


B2B Portal, Quote, Net 30: Speed up purchasing and streamline your quotation process with advanced features like quick order, request for quote.


B2B Lock Password Protect: Easily control access to pages, products, and pricing with robust features.


BSS Commerce - Full-service eCommerce Agency I Use Shopify for 1$ in the first month now

View solution in original post

Replies 3 (3)

BSSCommerce-B2B
Shopify Partner
1739 522 584

This is an accepted solution.

@Aleksander22 , Add this code before this postion i've marked here in main-register.liquid file

BSSCommerceB2B_0-1727519950064.png

Here is your code:  

 

<div style="display: flex; gap: 10px; align-items: start; margin: 2rem 0 0;">
      <input
        type="checkbox"
        name="customer[accepts_marketing]"
        value="true"
        id="marketing"
        style="margin: 0.5rem 0 0 0"
      >
      <label for="marketing" style="text-align: start; font-size: 14px">
        Tick here to receive emails about our products, apps, sales, exclusive content and more. View our
        <a href="/policies/terms-of-service" style="font-weight: bold">Privacy Policy.</a>
      </label>
    </div>

 

 

B2B Wholesale Solution: Streamline your B2B operation with advanced features like wholesale registration forms, custom pricing.


B2B Portal, Quote, Net 30: Speed up purchasing and streamline your quotation process with advanced features like quick order, request for quote.


B2B Lock Password Protect: Easily control access to pages, products, and pricing with robust features.


BSS Commerce - Full-service eCommerce Agency I Use Shopify for 1$ in the first month now

Aleksander22
Trailblazer
168 0 58

Thanks and how can I add image above the title. I mean this image 

IMG_1980.jpeg

BSSCommerce-B2B
Shopify Partner
1739 522 584

This is an accepted solution.

@Aleksander22, Change all the code in main-register.liquid file like this

{{ 'customer.css' | asset_url | stylesheet_tag }}

{%- style -%}
  .section-{{ section.id }}-padding {
    padding-top: {{ section.settings.padding_top | times: 0.75 | round: 0 }}px;
    padding-bottom: {{ section.settings.padding_bottom | times: 0.75 | round: 0 }}px;
  }

  @media screen and (min-width: 750px) {
    .section-{{ section.id }}-padding {
      padding-top: {{ section.settings.padding_top }}px;
      padding-bottom: {{ section.settings.padding_bottom }}px;
    }
  }
{%- endstyle -%}

<div class="customer register section-{{ section.id }}-padding">
  <h1>
    {% comment %}
      {{ 'customer.register.title' | t }}
    {% endcomment %}
    MY GLOVYZONE
  </h1>
  {% if section.settings.registration_logo %}
    <img
      class="registration-logo"
      src="{{ section.settings.registration_logo | img_url: 'original' }}"
      alt="Registration Logo"
      height="{{ section.settings.registration_logo_size}}"
    >
  {% endif %}
  {%- form 'create_customer', novalidate: 'novalidate' -%}
    {%- if form.errors -%}
      <h2 class="form__message" tabindex="-1" autofocus>
        <span class="svg-wrapper">
          {{- 'icon-error.svg' | inline_asset_content -}}
        </span>
        {{ 'templates.contact.form.error_heading' | t }}
      </h2>
      <ul>
        {%- for field in form.errors -%}
          <li>
            {%- if field == 'form' -%}
              {{ form.errors.messages[field] }}
            {%- else -%}
              <a href="#RegisterForm-{{ field }}">
                {{ form.errors.translated_fields[field] | capitalize }}
                {{ form.errors.messages[field] }}
              </a>
            {%- endif -%}
          </li>
        {%- endfor -%}
      </ul>
    {%- endif -%}
    <div class="field">
      <input
        type="text"
        name="customer[first_name]"
        id="RegisterForm-FirstName"
        {% if form.first_name %}
          value="{{ form.first_name }}"
        {% endif %}
        autocomplete="given-name"
        placeholder="{{ 'customer.register.first_name' | t }}"
      >
      <label for="RegisterForm-FirstName">
        {{ 'customer.register.first_name' | t }}
      </label>
    </div>
    <div class="field">
      <input
        type="text"
        name="customer[last_name]"
        id="RegisterForm-LastName"
        {% if form.last_name %}
          value="{{ form.last_name }}"
        {% endif %}
        autocomplete="family-name"
        placeholder="{{ 'customer.register.last_name' | t }}"
      >
      <label for="RegisterForm-LastName">
        {{ 'customer.register.last_name' | t }}
      </label>
    </div>
    <div class="field">
      <input
        type="email"
        name="customer[email]"
        id="RegisterForm-email"
        {% if form.email %}
          value="{{ form.email }}"
        {% endif %}
        spellcheck="false"
        autocapitalize="off"
        autocomplete="email"
        aria-required="true"
        {% if form.errors contains 'email' %}
          aria-invalid="true"
          aria-describedby="RegisterForm-email-error"
        {% endif %}
        placeholder="{{ 'customer.register.email' | t }}"
      >
      <label for="RegisterForm-email">
        {{ 'customer.register.email' | t }}
      </label>
    </div>
    {%- if form.errors contains 'email' -%}
      <span id="RegisterForm-email-error" class="form__message">
        <span class="svg-wrapper">
          {{- 'icon-error.svg' | inline_asset_content -}}
        </span>
        {{ form.errors.translated_fields.email | capitalize }}
        {{ form.errors.messages.email }}.
      </span>
    {%- endif -%}
    <div class="field">
      <input
        type="password"
        name="customer[password]"
        id="RegisterForm-password"
        aria-required="true"
        {% if form.errors contains 'password' %}
          aria-invalid="true"
          aria-describedby="RegisterForm-password-error"
        {% endif %}
        placeholder="{{ 'customer.register.password' | t }}"
      >
      <label for="RegisterForm-password">
        {{ 'customer.register.password' | t }}
      </label>
    </div>
    {%- if form.errors contains 'password' -%}
      <span id="RegisterForm-password-error" class="form__message">
        <span class="svg-wrapper">
          {{- 'icon-error.svg' | inline_asset_content -}}
        </span>
        {{ form.errors.translated_fields.password | capitalize }}
        {{ form.errors.messages.password }}.
      </span>
    {%- endif -%}
    <div style="display: flex; gap: 10px; align-items: start; margin: 2rem 0 0;">
      <input
        type="checkbox"
        name="customer[accepts_marketing]"
        value="true"
        id="marketing"
        style="margin: 0.5rem 0 0 0"
      >
      <label for="marketing" style="text-align: start; font-size: 14px">
        Tick here to receive emails about our products, apps, sales, exclusive content and more. View our
        <a href="/policies/terms-of-service" style="font-weight: bold">Privacy Policy.</a>
      </label>
    </div>
    <button>
      {{ 'customer.register.submit' | t }}
    </button>
  {%- endform -%}
</div>

{% schema %}
{
  "name": "t:sections.main-register.name",
  "settings": [
    {
      "type": "header",
      "content": "t:sections.all.padding.section_padding_heading"
    },
    {
      "type": "range",
      "id": "padding_top",
      "min": 0,
      "max": 100,
      "step": 4,
      "unit": "px",
      "label": "t:sections.all.padding.padding_top",
      "default": 36
    },
    {
      "type": "range",
      "id": "padding_bottom",
      "min": 0,
      "max": 100,
      "step": 4,
      "unit": "px",
      "label": "t:sections.all.padding.padding_bottom",
      "default": 36
    },{
      "type": "image_picker",
      "id": "registration_logo",
      "label": "Registration Logo",
    },
    {
      "type": "range",
      "id": "registration_logo_size",
      "label": "Registration Logo Size",
      "default": 50,
      "min": 20,
      "max": 100,
      "step": 5,
      "unit": "px"
    }
  ]
}
{% endschema %}

And then you have 2 option to choose the image and size

BSSCommerceB2B_0-1727522089754.png

Hope it helps you 😊

B2B Wholesale Solution: Streamline your B2B operation with advanced features like wholesale registration forms, custom pricing.


B2B Portal, Quote, Net 30: Speed up purchasing and streamline your quotation process with advanced features like quick order, request for quote.


B2B Lock Password Protect: Easily control access to pages, products, and pricing with robust features.


BSS Commerce - Full-service eCommerce Agency I Use Shopify for 1$ in the first month now