Skip to content

Instantly share code, notes, and snippets.

@geetfun
Created July 20, 2017 06:40
Show Gist options
  • Save geetfun/beaeaaa025835b0e14fdc12c678a00c8 to your computer and use it in GitHub Desktop.
Save geetfun/beaeaaa025835b0e14fdc12c678a00c8 to your computer and use it in GitHub Desktop.
<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