Return_to tag on currency form not working

Topic summary

Issue: The Shopify Liquid currency form’s return_to parameter (set to “back” or a relative path like /collections/earrings) intermittently redirects users to /cart instead of the intended previous/specified page.

Details:

  • Code snippet (central to understanding):
    {% form ‘currency’, return_to: ‘back’ %}
    {{ form | currency_selector }}
    {% endform %}
  • Behavior: Works sometimes; consistently fails in incognito, and intermittently in a standard browser.
  • Tested alternatives: Using a specific relative path shows the same issue.

Context: In Shopify, return_to indicates where to redirect after form submission (here, after selecting currency). The question is whether return_to is supported/reliable on the currency form and what causes the unexpected /cart redirect.

Status: No resolution or confirmed cause provided. The thread seeks clarification on whether return_to functions with the currency form and why the redirect overrides occur.

Summarized with AI on February 8. AI used: gpt-5.

We have a currency form with a return_to tag set to “back”. See example:

{% form 'currency', return_to:  'back'  %}
{{ form | currency_selector }}
{% endform %}

This works sometimes, however, in some cases, it will take the customer to the following path instead /cart. I have tested with a relative path e.g., /collections/earrings, and same issue occurs. I can replicate the issue always in incognito and sometime in standard browser.

Can someone explain what is causing the issue? Does the return_to tag not work in the currency form?

Thank you :slightly_smiling_face: