Skip to main content

Cart

Responsible for shopping carts and their items. Cart prices are promotion-aware: every read refreshes line prices to the current effective price (see Discount), and one coupon can ride along on the cart until checkout redeems it.

Tables​

TableDescription
cart_cartCarts (plus the optional applied coupon_code)
cart_cart_itemsLine items within a cart

Coupon endpoints​

EndpointAudiencePurpose
GET /cart/user/cart/couponUserShow the applied coupon + discount amount
POST /cart/user/cart/couponUserApply a code to the cart ({code})
DELETE /cart/user/cart/couponUserRemove the applied coupon

Evaluation rules and the transactional redemption gateway are documented in Discount; checkout re-evaluates the stored code inside its transaction and aborts with an invalid-coupon error if it no longer qualifies.

Events emitted​

EventWhen
CartCreatedEventA cart is created
CartItemAddedEventAn item is added
CartItemRemovedEventAn item is removed
CartCheckedOutEventA cart is checked out

Dependencies​

ModuleReason
InventoryStock availability checks
OrderCreates the new order on checkout
UserCustomer context
CatalogVariant summaries / promoted prices
DiscountCoupon evaluation and redemption at checkout