Product Object

Product object represents details of a specific product in cart.

Get product name and SKU in cart example:

Ecwid.OnCartChanged.add(function(cart) {
  console.log(cart.items[0].product.name + " in the cart has SKU: " + cart.items[0].product.sku);
});

// prints
// Apple product in the cart has SKU: TEST-1234

Subscribe to the Ecwid.OnAPILoaded JS API event to ensure availability of this function.

Fields:

NameTypeDescription
idintegerInternal unique product ID
namestringProduct name
priceintegerProduct price before applied tax (if store has "net prices" setting enabled)
shortDescriptionstringProduct description truncated to 120 characters
skustringProduct SKU
urlstringURL to this product details page in store front (store front URL is generated from a field in Ecwid Control panel > Settings > General > Store profile)
weightintegerWeight of a product