Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- javascript:!function(){var t="11",n="/cart/%ID%:%QUANTITY%";var o=new XMLHttpRequest;o.onreadystatechange=function(){if(4==o.readyState&&200==o.status){var r=JSON.parse(o.responseText),a=r.product.variants.filter(function(e){return e.option1==t});if(a=a?a[0]:null,!a)return alert("Your size is not available. Don't forget to replace it in the beginning of the script."),!1;var i={};i["%ID%"]=a.id,i["%QUANTITY%"]=1;var c=document.location.hostname+n;c=c.replace(/%\w+%/g,function(t){return i[t]||t}),document.location=document.location.protocol+"//"+c}},o.open("GET",document.location.href+".json"),o.send()}();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement