CartTotalSummary
Description
A headless render props component that provides cart summary data including subtotal, discount, shipping, tax, and grand total. When no children function is provided, it renders a DefaultCartSummary with Area-based extension points. When children is provided, it acts as a pure headless component.
Role in Theming
CartTotalSummary is one of EverShop's headless components — it owns the data extraction and tax-aware price formatting while leaving UI decisions to its parent:
- With no children, CartTotalSummary renders a default summary layout with Areas (
cartSummaryBeforeSubTotal,cartSummaryAfterSubTotal, etc.) that extensions can inject into. - With children, it renders nothing of its own — only what the
childrenfunction returns. - Theme developers override the parent components that use CartTotalSummary (
ShoppingCart,Checkout) to change the summary layout. - The data logic stays stable across themes. Tax-inclusive/exclusive price selection, loading state derivation, and cart data extraction are encapsulated.
Theme Override Points
CartTotalSummary is consumed by these components, which are the actual override targets for theme developers:
| Parent Component | Route | Override Path in Theme |
|---|---|---|
| ShoppingCart | cart | themes/<name>/src/pages/cart/ShoppingCart.tsx |
| Checkout | checkout | themes/<name>/src/pages/checkout/Checkout.tsx |