$("document").ready(function(){var n="https://shop.schwartz.co.uk/",t=n+"shoppingcartpage.aspx?continueshoppingurl="+window.location,i=n+"externalcart.aspx?status=true";$(".addtobasketlink").each(function(){$(this).click(function(){var e=$(this).attr("data-upc"),o=$(this).attr("data-itemname"),c=$(this).attr("data-price"),l=$("meta[name=brand]").attr("content"),t=$(this).attr("data-itemlistname"),r=undefined,u,f,s,h,i;t===undefined?(t=undefined,r=undefined):t===o&&(u=$("meta[name=name]").attr("content"),f=u.indexOf("|"),t=f!==-1?"product_sub_category_"+u.substring(0,f).replace("Online","").trim().replace(" ","_").toLowerCase():undefined,r=btoa(t));s=window.location.pathname;typeof initiateDataLayerEvent=="function"&&(h={event:"add_to_cart",ecommerce:{items:[{currency:"GBP",item_list_name:t,item_list_id:r,item_brand:l,item_category:s,item_name:o,item_id:e,item_variant:"Product",price:c,index:"1",quantity:"1"}]}},initiateDataLayerEvent(h));i=n;i+="externalcart.aspx?addtocart=true&productcode=";i+=e;i+="&refreshlocation=";i+=document.location;window.open(i,"_self","noopener,noreferrer")})});$("a.viewbasket").each(function(){$(this).attr("href",t);$(this).find("span").html("(<iframe id='cartCountFrame' name='cartCountFrame' width='11' height='12' frameborder='0' scrolling='no' src='"+i+"'><\/iframe>)")});$("a.basket").each(function(){$(this).attr("href",t)});$(".saved-recipes-count").each(function(){/Android|webOS|iPhone|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)?$(this).text(saves.length+" Saved Recipes"):$(this).text(saves.length)});$(".detail-data.ingredients-data").append("<span class='whisk_attach_here'><\/span>");$(".footer-logo-1").attr("src","/content/schwartz/images/footer/worldpay-logo.png");$(".footer-logo-2").attr("src","/content/schwartz/images/footer/paypal_logo.png")})