Shopify - Redirecting user after Activate Account form is submitted

家住魔仙堡 提交于 2020-12-06 03:03:54

问题


By default, when users Activate their account in a Shopify store, they are redirected to their account page. I'd like to change the destination of that redirect to another page in the Shopify store. I've successfully done this for the Customer Login page to prevent redirection to the account page using a hidden input field for checkout_url, as described in this Shopify support post: http://support.shopify.com/customer/portal/articles/313065-is-it-possible-to-be-redirected-to-a-special-page-upon-being-logged-in-successfully-

However, this approach is not working on the Activate Account form page. Has anyone successfully done this? At least one other Shopify user has encountered this problem as well. http://ecommerce.shopify.com/c/shopify-discussion/t/account-activation-form-redirect-105959#comment-113150

Any help would be much appreciated. Thanks!


回答1:


The good folks at Shopify got back to me about this one. Apparently the following needs to be added to the form:

<input type="hidden" name="return_to" value="**destination**" />



回答2:


In the end I gave up trying to use the

<input type="hidden" name="return_to" value="**destination**" />

I solved it by adding this script to my /account/ template page

 <script type="text/javascript">
 $(document).ready(function () {
 $(function() {
 if (window.location.href != "http://[yourshopname].com/account") {
 document.location = 'http://[yourshopname].com/'
 }
 }); 
 }); 

 </script>


来源:https://stackoverflow.com/questions/13244556/shopify-redirecting-user-after-activate-account-form-is-submitted

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!