Skip to content

Instantly share code, notes, and snippets.

View gist:6496917
Ecwid.Cart.addProduct(productID, function(success, product, cart){
console.log(success); // true or false
console.log(product.name);
})
View gist:6496827
Ecwid.Cart.addProduct(productID, callback)
View gist:6496848
var productId = 10;
Ecwid.Cart.addProduct(productId);
View gist:6496390
Ecwid.OnCartChanged.add(function(cart){
// your code here
})
@rimmer333
rimmer333 / gist:6001099
Created Jul 15, 2013
Hiding the prices for out of stock products
View gist:6001099
td.ecwid-productBrowser-productsGrid-cell-outOfStock div.ecwid-productBrowser-price,
tr.ecwid-productBrowser-productsList-productRow-outOfStock div.ecwid-productBrowser-price,
tr.ecwid-productBrowser-productsTable-row-outOfStock div.ecwid-productBrowser-price,
div.ecwid-productBrowser-detailsContainer-outOfStock div.ecwid-productBrowser-price {
display: none;
}
@rimmer333
rimmer333 / ecwid-productbrowser-codegen.html
Created Jun 18, 2013
Ecwid product browser code generator.
View ecwid-productbrowser-codegen.html
<style>.codegen-widget {
padding: 1em;
background-color: #eaf3fa;
font: normal 16px tahoma, geneva, verdana, sans-serif;
}
.codegen-widget small {
font-size: 75%;
}
.codegen-widget input {
font: normal 16px tahoma, geneva, verdana, sans-serif;
View gist:5796077
div.ecwid-floatLeftPanel {
float: left;
text-align: right;
}
div.ecwid-PaymentMethodsBlock-PaymentOption {
text-align: right;
}
div.ecwid-fieldWrapper {
overflow: hidden;
}
View classHiddenForm.coffee
class HiddenForm
d = document
constructor: (fields, attributes={})->
@form_element = d.createElement 'form'
for own name, value of fields
@add_field name, value
for own name, value of attributes
@form_element.setAttribute name, value
@form_element.setAttribute 'style', 'display: none'
d.body.appendChild(@form_element)
@rimmer333
rimmer333 / ecwid-cash-on-delivery.js
Created Jun 8, 2012
Hide or show payment methods in Ecwid depending on the delivery methods selected
View ecwid-cash-on-delivery.js
/*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("c"==b?v:u,a,b,this.i++,c,d,f):(p.splice(this.i++,0,a),1==p.length&&h()),this}function k(){v