Created
July 20, 2017 06:40
-
-
Save geetfun/beaeaaa025835b0e14fdc12c678a00c8 to your computer and use it in GitHub Desktop.
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
<style type="text/css"> | |
.ajaxcart__product-meta, | |
.cart__product-property { | |
display: none; | |
} | |
</style> | |
<script type="text/javascript"> | |
var cssClasses = [".ajaxcart__product-meta", ".cart__product-property"]; | |
setInterval(function() { | |
jQuery.each(cssClasses, function(index, cssClass) { | |
if ($(cssClass).length) { | |
$(cssClass).each(function(index, element) { | |
var $this = $(element); | |
var content = $this.html(); | |
if (content.includes("cf_sub_id")) { | |
var contentArray = content.split(":"); | |
var cf_sub_id = contentArray[1].trim(); | |
var url = "https://yoursubdomain.cartfunnel.net/api/subscriptions/" + cf_sub_id + ".json"; | |
$.getJSON(url, function(response) { | |
var title = response.title; | |
$this.html(title); | |
$this.data('cf-sub-completed', true); | |
}); | |
}; | |
$this.css("display", "block"); | |
}); | |
}; | |
}); | |
}, 250); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment