var appurl = 'https://affiliatify.ejify.com/'; var shop_name = 'lojadosyoutubers.myshopify.com'; $.getJSON(document.URL, function(data) { $.ajax({ url: appurl+"affiliatify.php", type: "POST", data: {shop_name: shop_name, product_id: data.product.id}, dataType: "json", success: function(res) { if(res.result == "true") { if(res.data.status == 'on'){ $("form").each(function(){ if($(this).attr('action') == '/cart/add'){ $(this).append(res.data.output).fadeIn(3000); } $("div[itemprop='offers']").css({'visibility':'initial'}); }); }else{ $("form").each(function(){ if($(this).attr('action') == '/cart/add'){ $(this).find('.product-single__variants').each(function(){ }); $( this.elements ).show(); //$( this).find("div").show(); } $("div[itemprop='offers']").css({'visibility':'initial'}); }); $('form[action="/cart/add"] input[type="submit"], form[action="/cart/add"] input[type="button"], form[action="/cart/add"] button').show(); } } } }); }); function update_stats_click(shop_id, stat_id, product_id){ $.get("https://affiliatify.ejify.com/update.php?action=click&stat_id="+stat_id+"&shop_id="+shop_id+"&product_id="+product_id, function(html) { //globalStore.html = html; }); }