-
-
Save makfruit/02f4fac0cc54d8321c12 to your computer and use it in GitHub Desktop.
A simple JS snippet to add product to the cart using Ecwid Javascript API
This file contains 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 product = { | |
id: 10, | |
quantity: 3, | |
options: { | |
someTextOption: "optionVal", | |
someDateOption: new Date().getTime().toString(), | |
someRadioOption: "optionVal", | |
someDropDownOption: "optionVal", | |
someCheckboxOption: ["optionVal1", "optionVal2"] | |
}, | |
callback: function(success, product, cart) { | |
// ... | |
} | |
} | |
Ecwid.Cart.addProduct(product); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment