DashForDevsDocs
DocsNewsAPI v1
dashfordevs.comSign in

© 2026 DashForDevs

DocsNewsdashfordevs.comLegalStatus
DocsSDK Referencedash.cart
Introduction
Getting Started
Authentication
Products
Categories
Cart
Checkout
Blog
Reviews
Webhooks
Customers
Orders
Inventory
Shipping
Discounts
Affiliates
Email
Media & Files
Analytics & Tracking
Locations
Tax
Global Data
SEO
Error Handling
Geography
Finance
Automations
Page Types
Surveys
Billing & Subscriptions
Storefront Payments
SDK Reference
admin moduleDashClientaffiliates moduledash.productsauth moduledash.categoriesblog moduledash.cartbrands moduledash.checkoutcalendar moduledash.authCart Moduledash.customercategories moduledash.blogcheckout moduledash.reviewscoa moduledash.shippingcontact moduledash.discountscontent-types moduledash.locationsdash.getGlobalDatadiscount-store moduledash.contactearn-points moduledash.seoemail moduleforms modulehtml-templates modulelegal modulemarketing modulemedia modulepage-groups modulepages modulepayment modulePayment Methods Moduleproducts modulereferrals moduleseo moduleshipping modulesitemap moduletax moduleSubscriptions Moduletracking moduleupload moduleinsights modulesurvey module
REST API
Storefront Architecture
Notifications
Security
Team & Permissions
Migrations & Import
Calendar & Appointments
Contact Forms
AI Bots
Dashboard API
Deployment
Changelog
Troubleshooting
Recipes
CLI & Deployment
Image Pipeline
White-label Platforms
Records Engine
Platform Modules
Platform Security
Site Keys & Client Sites
Use Cases
Operations

dash.cart

Cart management methods: get, add, update, remove.

Updated March 29, 2026

On this page
  • dash.cart
  • Properties
  • get()
  • load(cartId)
  • add(options)
  • update(sizeId, quantity)
  • remove(sizeId)
  • clear()
  • applyDiscount(code) / removeDiscount()
  • migrateToUser() / loadUserCart()
  • reset()

dash.cart

Properties

typescript
dash.cart.cartId           // string | null
dash.cart.items            // CartItem[]
dash.cart.getTotals()      // { itemCount, subtotal }
dash.cart.getTotalQuantity() // number

get()

typescript
const { cart_id, items, subtotal, item_count } = await dash.cart.get()

load(cartId)

typescript
const cart = await dash.cart.load("cart_xyz")

add(options)

typescript
const { cart_id, item } = await dash.cart.add({ productId: "prod_abc", sizeId: "size_1g", quantity: 1 })

update(sizeId, quantity)

typescript
await dash.cart.update("size_1g", 3)

remove(sizeId)

typescript
await dash.cart.remove("size_1g")

clear()

typescript
await dash.cart.clear()

applyDiscount(code) / removeDiscount()

typescript
await dash.cart.applyDiscount("SAVE20")
await dash.cart.removeDiscount()

migrateToUser() / loadUserCart()

typescript
await dash.cart.migrateToUser()    // merge guest cart → user
await dash.cart.loadUserCart()     // load user's persistent cart

reset()

Clear local state without touching the server.

See Cart for full details.

Previousblog moduleNextbrands module

On this page

  • dash.cart
  • Properties
  • get()
  • load(cartId)
  • add(options)
  • update(sizeId, quantity)
  • remove(sizeId)
  • clear()
  • applyDiscount(code) / removeDiscount()
  • migrateToUser() / loadUserCart()
  • reset()