Skip to content

Instantly share code, notes, and snippets.

View gist:6497160
Ecwid.Cart.get(function(cart) {
alert(cart.productsQuantity + " products in cart now");
});
View gist:6496917
Ecwid.Cart.addProduct(productID, function(success, product, cart){
console.log(success); // true or false
console.log(product.name);
})
View gist:6496872
product = {
id: 10,
quantity: 3,
options: {
someTextOption: "optionVal",
someDateOption: (new Date()).getTime().toString()
},
callback: function(success, product, cart) {
// ...
}
View gist:6496848
var productId = 10;
Ecwid.Cart.addProduct(productId);
View gist:6496827
Ecwid.Cart.addProduct(productID, callback)
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;
}