Skip to content

Title Methods

SmartCart.getCartTitlestring

Get the cart title

Returns: string - the cart title text

Example

// Get the current cart title
const title = SmartCart.getCartTitle();
console.log(title); // "Your Cart"

// Use in a custom header component
document.querySelector('.my-cart-header').textContent = SmartCart.getCartTitle();
See something that needs updating? Suggest an edit