问题
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