Last updated

getCart()

Fetches the current cart from the API.

Signature

const cart = await window.FairShareSDK.getCart();

Returns

Promise<Cart> — The current cart object from the API.

Example

// Fetch and display cart contents
const cart = await window.FairShareSDK.getCart();

console.log('Cart ID:', cart.id);
console.log('Items:', cart.items.length);
console.log('Total:', cart.total);