All things Shopify and commerce
Hi there! Thanks in advance for your help. I am currently using this code to ask users to sign up for our newsletter. How do I also ask for their contact name as well as their phone number?
Theme: impulse
Path: snippets/newsletter-form.liquid
Code:
{%- assign newsletter_form_id = 'newsletter-' | append: section_id -%}
{% form 'customer', id: newsletter_form_id %}
{%- if form.posted_successfully? -%}
<div class="note note--success">
{{ 'general.newsletter_form.newsletter_confirmation' | t }}
</div>
{%- endif -%}
{%- if form.errors and form.context == snippet_context -%}
{{ form.errors | default_errors }}
{%- endif -%}
{%- unless form.posted_successfully? -%}
<label for="Email-{{ section_id }}" class="hidden-label">{{ 'general.newsletter_form.newsletter_email' | t }}</label>
<label for="newsletter-form-submit-{{ section_id }}" class="hidden-label">{{ 'general.newsletter_form.submit' | t }}</label>
<input type="hidden" name="contact[tags]" value="prospect,newsletter">
<input type="hidden" name="contact[context]" value="{{ snippet_context }}">
<div class="input-group newsletter__input-group">
<input type="email" value="{% if customer %}{{ customer.email }}{% endif %}" placeholder="{{ 'general.newsletter_form.newsletter_email' | t }}" name="contact[email]" id="Email-{{ section_id }}" class="input-group-field newsletter__input" autocorrect="off" autocapitalize="off" required>
<div class="input-group-btn">
<button type="submit" id="newsletter-form-submit-{{ section_id }}" class="btn" name="commit">
<span class="form__submit--large">{{ 'general.newsletter_form.submit' | t }}</span>
<span class="form__submit--small">
<svg aria-hidden="true" focusable="false" role="presentation" class="icon icon--wide icon-arrow-right" viewBox="0 0 50 15"><title>icon-right-arrow</title><path d="M0 9.63V5.38h35V0l15 7.5L35 15V9.63Z"/></svg>
</span>
</button>
</div>
</div>
{%- endunless -%}
{% endform %}
Solved! Go to the solution
This is an accepted solution.
This is an accepted solution.
here's how you can do that
Thank you very much Mr. Ahmed, I would like to try it immediately. Can you share the complete code?
ahmadmahmood6022@outlook.com here is my email where you can contact me to get get complete code
FIRST NAME
LAST NAME
PHONE
PASSWORD
Can it be this way? You can sign up via email from this pop-up window. A password will be required to log in. Can you create a password from here?
To show the popup, you will need a bit of JavaScript
Thank you very much, it really helped me a lot, thank you
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