This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ecwid.Cart.calculateTotal(function(order) { | |
if (!order) | |
alert('An error occurred!') | |
else | |
alert('Order total: ' + order.total); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ecwid.Cart.get(function(cart) { | |
alert(cart.productsQuantity + " products in cart now"); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ecwid.Cart.addProduct(productID, function(success, product, cart){ | |
console.log(success); // true or false | |
console.log(product.name); | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
product = { | |
id: 10, | |
quantity: 3, | |
options: { | |
someTextOption: "optionVal", | |
someDateOption: (new Date()).getTime().toString() | |
}, | |
callback: function(success, product, cart) { | |
// ... | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var productId = 10; | |
Ecwid.Cart.addProduct(productId); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ecwid.Cart.addProduct(productID, callback) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ecwid.Cart.addProduct(product) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ecwid.OnCartChanged.add(function(cart){ | |
// your code here | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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; |