You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在Shopify注册表单添加跳转且确保信息填写合规

问题:Shopify注册表单添加跳转后丢失校验功能
  • 需求:实现Shopify注册成功后自动跳转到/account/addresses页面
  • 异常情况:添加跳转配置后,表单确实能完成跳转,但用户填写错误信息或留空表单时,原本的校验报错功能失效;移除跳转配置后,表单的校验逻辑恢复正常
  • 已尝试的无效方案:
    1. 静态添加隐藏input字段:
      <input type="hidden" name="return_to" value="/account/addresses">
      
    2. 动态插入隐藏input的脚本:
      (function() {
        var REDIRECT_PATH = '/account/addresses';
        var selector = '#create_customer, form[action$="/account"][method="post"]',
            $form = document.querySelectorAll(selector)[0];
        if ($form) {
          $redirect = document.createElement('input');
          $redirect.setAttribute('name', 'return_to');
          $redirect.setAttribute('type', 'hidden');
          $redirect.value = REDIRECT_PATH;
          $form.appendChild($redirect);
        }
      })();
      

内容的提问来源于stack exchange,提问作者StasiewiczJacob

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.25 23:54:58