Get Cart
Retrieve the current cart contents and totals.
Updated
On this page
Overview
Retrieve the current cart contents. The SDK automatically tracks the cart ID in localStorage, so you don't need to manage it manually.
SDK Usage
import dash from "@/lib/dash"
const { cart_id, items, subtotal, item_count } = await dash.cart.get()
// items = [
// {
// size_id: "size_abc",
// product_id: "prod_123",
// product_name: "Blue Dream",
// product_slug: "blue-dream",
// variation_name: "Blue Dream",
// size_label: "1g",
// unit_price: "29.99",
// quantity: 2,
// subtotal: "59.98",
// in_stock: true,
// product_image: "https://...",
// }
// ]