Skip to content

Instantly share code, notes, and snippets.

@stewartknapman
Last active March 29, 2017 22:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stewartknapman/a1bb9f48ac1b2b20d4771bf7449352cb to your computer and use it in GitHub Desktop.
Save stewartknapman/a1bb9f48ac1b2b20d4771bf7449352cb to your computer and use it in GitHub Desktop.
Redirect the Shopify account register form to custom message pages
{% if form.errors and form.errors contains "form" %}
{% capture error_output %}{{ form.errors | default_errors }}{% endcapture %}
{% capture reset_password %}{{ 'shopify.errors.reset_password_html' | t }}{% endcapture %}
{% capture verify_email %}{{ 'shopify.errors.verify_email' | t: customer_email: "*" | split: "*" | first }}{% endcapture %}
{% if error_output contains reset_password %}
<script>
window.location = "/pages/you-have-an-account";
</script>
{% elsif error_output contains verify_email %}
<script>
window.location = "/pages/verify-your-account";
</script>
{% endif %}
{% endif %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment