Skip to content

Instantly share code, notes, and snippets.

@makfruit
makfruit / ecwid_add_product.js
Last active August 29, 2015 14:05 — forked from genee19/new_gist_file
A simple JS snippet to add product to the cart using Ecwid Javascript API
var product = {
id: 10,
quantity: 3,
options: {
someTextOption: "optionVal",
someDateOption: new Date().getTime().toString(),
someRadioOption: "optionVal",
someDropDownOption: "optionVal",
someCheckboxOption: ["optionVal1", "optionVal2"]
},
@makfruit
makfruit / ecwid-cash-on-delivery.js
Last active December 1, 2016 04:56 — forked from genee19/ecwid-cash-on-delivery.js
Hide or show payment methods in Ecwid depending on the delivery methods selected
/*
* Hide or show payment methods in Ecwid depending on the delivery methods selected
*/
/*yepnope1.5.x|WTFPL*/
(function(a,b,c){function d(a){return"[object Function]"==o.call(a)}function e(a){return"string"==typeof a}function f(){}function g(a){return!a||"loaded"==a||"complete"==a||"uninitialized"==a}function h(){var a=p.shift();q=1,a?a.t?m(function(){("c"==a.t?B.injectCss:B.injectJs)(a.s,0,a.a,a.x,a.e,1)},0):(a(),h()):q=0}function i(a,c,d,e,f,i,j){function k(b){if(!o&&g(l.readyState)&&(u.r=o=1,!q&&h(),l.onload=l.onreadystatechange=null,b)){"img"!=a&&m(function(){t.removeChild(l)},50);for(var d in y[c])y[c].hasOwnProperty(d)&&y[c][d].onload()}}var j=j||B.errorTimeout,l=b.createElement(a),o=0,r=0,u={t:d,s:c,e:f,a:i,x:j};1===y[c]&&(r=1,y[c]=[]),"object"==a?l.data=c:(l.src=c,l.type=a),l.width=l.height="0",l.onerror=l.onload=l.onreadystatechange=function(){k.call(this,r)},p.splice(e,0,u),"img"!=a&&(r||2===y[c]?(t.insertBefore(l,s?null:n),m(k,j)):y[c].push(l))}function j(a,b,c,d,f){return q=0,b=b||"j",e(a)?i(