Skip to main content
The basket object contains all information about the customer’s shopping cart. It’s available globally across all pages, making it perfect for cart widgets, mini-carts, and checkout processes.
Usage: Available globally - use anywhere to display cart contents, totals, and checkout links

Basic Cart Information

Access the essential cart data for displaying cart status and totals:

Available Properties

Cart Items

Loop through cart items to display detailed cart contents:

Cart Item Properties

When looping through basket.items, each item has these properties:

Checkout Integration

The paylink provides the correct checkout URL when the cart is not empty:

Mini Cart Examples

Slide-out Cart

Cart Page Template

Mobile Cart Examples

Mobile Cart Badge

Best Practices

Empty State Handling

Always provide meaningful empty cart states with clear calls-to-action

Performance

Use image optimization with the {{#img}} wrapper for cart item thumbnails

Accessibility

Include proper ARIA labels and semantic HTML for cart interactions

Mobile First

Design cart widgets to work well on all screen sizes

Common Patterns

Cart Item Counter

Quick Add Success Message

Next Steps

Navigation Object

Build dynamic navigation menus and breadcrumbs

Product Object

Learn about displaying individual product information

Order Object

Display order confirmation and thank you page content

Shop Object

Explore store-wide settings and information