How to redirect to another page after a successful contact form submission in Shopify
By default after successfully submitting the contact form then a message will appear in Shopify. One question the merchants are frequently asked is how to redirect users to a URL or website, after they’ve successfully submitted a contact form. In this article, I’ll also share how to send the visitor to a different page after they’ve successfully submitted a form. This means you can send them to the promotion landing page that best suits their interests.
It’s very simple, you just need to open the form code and insert the below code inside the form tag.
1 2 3 4 | {%- if form.posted_successfully? -%} <style>body{display:none!important!}</style> <script>window.location.replace("https://www.huratips.com");</script> {%-endif -%} |
Inside, you can replace https://www.huratips.com to your page you want.
I hope it’s helpful to you.
Happy coding!