Created
May 30, 2017 23:06
-
-
Save samnazari/f4638389b671301c51cb7d16335ded21 to your computer and use it in GitHub Desktop.
Ascend - Shopify - Shopping Cart Integration
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"> | |
function getCookie(name) { | |
var value = "; " + document.cookie; | |
var parts = value.split("; " + name + "="); | |
if (parts.length == 2) return parts.pop().split(";").shift(); | |
} | |
var ascendCookies = getCookie('_ascend_current'); | |
var ascendInput = document.createElement('input'); | |
ascendInput.type = 'hidden'; | |
ascendInput.name = 'attributes[ascend]'; | |
ascendInput.value = ascendCookies; | |
document.querySelector('form.cart').appendChild(ascendInput); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment