Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Hello Shopify Community!
I made the logout link in the headless side, and its link is account/login When I click this link, I removed cookie data, and redirects to this link, then it is logged out of Shopify store.
Are there any solution for this? Like the redirect after login. We can redirect to custom page after Shopify login using the following link account/logout. I want this kind of solution for logout or any other solutions.
Thank you in advance.
you can use this in theme.liquid before end the body tag
<script>
$(document).ready( function() {
$('a[href^="/account/logout"]').on("click", function() {
$.ajax( $(this).attr('href') )
.done(function() {
window.location.href = "/cart";
});
return false;
});
});
</script>
June brought summer energy to our community. Members jumped in with solutions, clicked ...
By JasonH Jun 5, 2025Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025