Created
July 12, 2019 11:15
-
-
Save martinsoender/4225a22dc3b622c2e459d3dd247c0970 to your computer and use it in GitHub Desktop.
Split it checkout
This file contains hidden or 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
// Splitit | |
if(location.href.indexOf('/checkouts/') >= 0) { | |
// Splitit styles injection | |
const splititStyles = document.createElement('link'); | |
splititStyles.setAttribute('rel', 'stylesheet'); | |
splititStyles.setAttribute('src', '//cdn.shopify.com/s/files/1/0027/5536/2879/files/splitit-styles.css?56959'); | |
document.getElementsByTagName('head')[0].appendChild(splititStyles); | |
// JQuery injection | |
var ccJqueryScript = document.createElement('script'); | |
ccJqueryScript.setAttribute('type', 'text/javascript'); | |
ccJqueryScript.setAttribute('src', '//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js'); | |
document.getElementsByTagName('head')[0].appendChild(ccJqueryScript); | |
// Checkout js injection | |
var ccScript = document.createElement('script'); | |
ccScript.setAttribute('type', 'text/javascript'); | |
ccScript.setAttribute('src', '//cdn.shopify.com/s/files/1/0027/5536/2879/files/splitit-checkout.js?56963'); | |
document.getElementsByTagName('head')[0].appendChild(ccScript); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment