Managing the Cart
This page describes some helpful Javascript functions that allow you to manage the cart.
Add Recommended Products to Cart
Nosto.addSkuToCart({productId: '123', skuId: '124'}, 'frontpage-nosto-1')async function addToCart(productId, skuId, attribution) {
await Nosto.addSkuToCart({ productid, skuId }, attribution)
const api = await new Promise(nostojs)
await api.loadRecommendations()
}
// usage example
try {
await addToCart("5637201", "7420583", "frontpage-1")
} catch (e) {
console.warn("Cart addition failed", e)
}
Leveraging Quantities
Adding Multiple Products
Use Cases
Migrating from the Legacy approach
Last updated