All things Shopify and commerce
Hello Shopify Community!
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>
I would like to redirect users to two different urls depending on the link selected. I've been trying to work out a way to pass a condition to your script, which others have shared, but can't come up with a way to do it. Any ideas?
I used the following method
<a href="/account/logout?return_url=%2Faccount" >Logout</a>
User | RANK |
---|---|
43 | |
40 | |
24 | |
24 | |
22 |
Transform this holiday season into a shopping spree. Plus, learn how to effortlessly open ...
By Jasonh Dec 8, 2023Make the shift from discounts to donations, and witness your business not only thrive fina...
By Holly Dec 4, 2023On our Shopify Expert Marketplace, you can find many trusted third party developers and fr...
By Arno Nov 27, 2023