-
-
Save aaliyan111/8e38d17928e350b4b2839e87f0c99ef5 to your computer and use it in GitHub Desktop.
Add this at the bottom of cart.liquid to auto-save your cart attributes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript" charset="utf-8"> | |
//<![CDATA[ | |
jQuery(function() { | |
jQuery(window).unload(function() { | |
var params = { | |
type: 'POST', | |
url: '/cart/update.js', | |
data: jQuery('form[action="/cart"]').serialize(), | |
dataType: 'json', | |
async: false | |
}; | |
jQuery.ajax(params); | |
}); | |
}); | |
//]]> | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment