All things Shopify and commerce
I am using Dawn theme and the customer registration process is kept the same (customers enter their email address, the website send a verification code to the said email address, customer enters the code and logs in). After the customer logs in I want to add additional form where I ask customers if they want to join our testing panel and if they click on yes I want to collect customers age, product preference, health concerns faced by them etc.
Solved! Go to the solution
This is an accepted solution.
Hi @Abhinay ,
To redirect users to a contact form after login and collect additional data (age, product preference, health concerns), follow these steps:
Modify customers/login.liquid to redirect users to the contact form after successful login.
<script>
document.addEventListener("DOMContentLoaded", function () {
if (window.location.href.includes("account")) {
window.location.href = "/pages/testing-panel-form"; // Redirect to your custom form
}
});
</script>
Go to Shopify Admin → Online Store → Pages → Add Page
In Edit Code, modify page.contact.liquid (or create a new template).
Example Contact Form Code (templates/page.testing-panel.liquid)
{% section 'contact-form' %}
{% schema %}
{
"name": "Testing Panel Form",
"settings": []
}
{% endschema %}
Then, edit sections/contact-form.liquid and add custom fields:
<form method="post" action="/contact#contact_form" id="contact_form" accept-charset="UTF-8">
<input type="hidden" name="form_type" value="contact">
<input type="hidden" name="utf8" value="✓">
<label for="name">Name</label>
<input type="text" id="name" name="contact[name]" required>
<label for="email">Email</label>
<input type="email" id="email" name="contact[email]" required>
<label for="age">Age</label>
<input type="number" id="age" name="contact[age]" min="18" required>
<label for="product_preferences">Product Preferences</label>
<input type="text" id="product_preferences" name="contact[product_preferences]">
<label for="health_concerns">Health Concerns</label>
<textarea id="health_concerns" name="contact[health_concerns]"></textarea>
<button type="submit">Submit</button>
</form>
This is an accepted solution.
Hi @Abhinay ,
To redirect users to a contact form after login and collect additional data (age, product preference, health concerns), follow these steps:
Modify customers/login.liquid to redirect users to the contact form after successful login.
<script>
document.addEventListener("DOMContentLoaded", function () {
if (window.location.href.includes("account")) {
window.location.href = "/pages/testing-panel-form"; // Redirect to your custom form
}
});
</script>
Go to Shopify Admin → Online Store → Pages → Add Page
In Edit Code, modify page.contact.liquid (or create a new template).
Example Contact Form Code (templates/page.testing-panel.liquid)
{% section 'contact-form' %}
{% schema %}
{
"name": "Testing Panel Form",
"settings": []
}
{% endschema %}
Then, edit sections/contact-form.liquid and add custom fields:
<form method="post" action="/contact#contact_form" id="contact_form" accept-charset="UTF-8">
<input type="hidden" name="form_type" value="contact">
<input type="hidden" name="utf8" value="✓">
<label for="name">Name</label>
<input type="text" id="name" name="contact[name]" required>
<label for="email">Email</label>
<input type="email" id="email" name="contact[email]" required>
<label for="age">Age</label>
<input type="number" id="age" name="contact[age]" min="18" required>
<label for="product_preferences">Product Preferences</label>
<input type="text" id="product_preferences" name="contact[product_preferences]">
<label for="health_concerns">Health Concerns</label>
<textarea id="health_concerns" name="contact[health_concerns]"></textarea>
<button type="submit">Submit</button>
</form>
Perfect! Thank you for the help.
Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025Unlock the potential of marketing on your business growth with Shopify Academy's late...
By Shopify Mar 12, 2025Learn how to increase conversion rates in every stage of the customer journey by enroll...
By Shopify Mar 5, 2025