Shopify themes, liquid, logos, and UX
Hello,
I need help with adding check box like here to my register form
And I here how my form looks like
Solved! Go to the solution
This is an accepted solution.
@Aleksander22 , Add this code before this postion i've marked here in main-register.liquid file
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
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
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
This is an accepted solution.
@Aleksander22 , Add this code before this postion i've marked here in main-register.liquid file
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
Thanks and how can I add image above the title. I mean this image
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
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
Starting a B2B store is a big undertaking that requires careful planning and execution. W...
By JasonH Sep 23, 2024By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024