Form return_to not working as expected

Form return_to not working as expected

Shopify Partner
2 0 0

Following the information given in
I'm unable to redirect the user after he submits an email via the `newsletter.liquid` section, I can validate that the hidden input tag has been added with the correct URL I want to redirect to.

What happens: After I submit an email I get redirected to `/challenge#contact_form` page with the reCAPTCHA(Issue 2), after I submit "I'm not a robot" I get redirected again to the root page `/?customer_posted=true`


Issue 2: I don’t understand why reCAPTCHA is being displayed even though I have all settings disabled.


Code changes:

Resulting HTML:


reCAPTCHA settings:



Replies 2 (2)

Shopify Partner
1 0 0

Hi there,


Are you testing this locally? Because if so you should test it with the preview link and not with your local link because that will trigger the recaptcha!

I have the same issue where it doesn't let me use a captured variable in the return_to... 
When using a string it works but I need to pass a variable and this doesn't work.. have you tried it with a hardcoded string already?

Shopify Partner
2 0 0

Yes, I'm testing using the local link.
I have not tested with the hardcoded string since the use case I need is for it to be configurable.

My workaround 🐒🔨 was using the form.posted_successfully? to know when I could force the window location to change via JS.

{%- if form.posted_successfully? -%}
  {% if section.settings.redirect_url != blank -%}
    <script type="text/javascript">
      window.location = "{{ section.settings.redirect_url.url }}";
  {%- endif %}