Knowledge base — Definition
Shopping Cart
What an eCommerce shopping cart is, how carts store items and calculate totals, and how to design a cart page that moves shoppers to checkout.
What Is a Shopping Cart?
A shopping cart is the part of an online store that holds the products a shopper has selected, along with quantities, variations and a running total, until they are ready to check out. It usually appears in two forms: a mini-cart (an icon, drawer or dropdown in the header) and a full cart page where items can be reviewed and edited.
Behind the interface, the cart is a piece of session data. For a guest, it is typically tied to a cookie that identifies their session on the server or stored in the browser; for a logged-in customer, it can be saved to their account so it follows them across devices. "Shopping cart software" is also sometimes used loosely to mean an entire eCommerce platform, but this entry covers the cart itself.
Why the Shopping Cart Matters
The cart is the bridge between browsing and buying, and the first place shoppers see what an order will really cost.
- Decision checkpoint: Shoppers use the cart to confirm sizes, colours and quantities before committing, so it must show variations clearly.
- Cost discovery: Shipping estimates, discounts and tax first appear here, and surprises at this stage are a major source of cart abandonment.
- Order value: Relevant add-ons, free-shipping thresholds and bundle offers can be presented naturally at this point.
- Performance: Cart pages are personalized and cannot be fully cached, so they put more load on your server than ordinary pages.
- Inventory accuracy: How the cart handles stock determines whether two customers can end up buying the last unit.
How a Shopping Cart Works
- Add to cart: The product page sends the product, variation and quantity to the store, often by AJAX so the page does not reload.
- Session storage: The store records the cart against a session cookie or customer account, and the mini-cart updates to reflect it.
- Totals calculation: The cart applies prices, coupons, shipping estimates and tax rules to produce subtotal and total, recalculating on every change.
- Validation: Before checkout, the store re-checks stock, prices and coupon validity so outdated carts cannot create incorrect orders.
- Persistence and expiry: Guest carts expire after a set period, while account carts can be restored at the next login. In WooCommerce, stock is reduced when an order is placed, with a configurable hold for unpaid orders.
Common Shopping Cart Mistakes
- Hiding the shipping cost: Showing only a subtotal and leaving the shipping total for the final step.
- Hard-to-edit items: Tiny quantity controls, no way to change a variation without removing the item, or a remove link that is easy to tap by accident.
- Losing the cart: Short session lifetimes or cookie problems that empty the cart when a shopper returns or logs in.
- Caching cart content: Misconfigured page caching that shows one visitor's cart count or contents to another.
- Burying the checkout button: Upsells, coupon fields and banners pushing the main action below the fold on mobile.
Best Practices for Shopping Carts
- Confirm every add: Give clear feedback, such as an updated count and an opening mini-cart drawer, without sending the shopper away from the product.
- Show the details that matter: Thumbnail, product name, selected options, unit price, quantity and line total for each item.
- Estimate costs up front: Offer a postal code shipping estimate and show tax handling so the total holds no surprises.
- Keep one clear primary action: A prominent checkout button, with secondary actions such as "continue shopping" visually quieter.
- Exclude cart and checkout from caching: Configure your caching and CDN to bypass these pages and cart cookies, and make sure cart fragments do not slow every other page.
- Make it accessible: Announce cart updates to screen readers, label quantity controls clearly and keep the cart fully usable by keyboard.
Shopping Carts at PerfectPixels
We design cart and mini-cart experiences for WooCommerce and custom stores, configure caching so carts stay fast and private, and build custom cart rules, such as minimum orders, wholesale pricing or product bundles, when the defaults do not fit. It is part of our eCommerce design and development work, tested on real devices before launch.
Frequently Asked Questions
What is the difference between a cart and a checkout?
The cart is where shoppers collect and review items and see estimated totals. The checkout is where they enter contact, delivery and payment details to place the order. Some stores combine them, but they serve different jobs.
How long should items stay in a shopping cart?
Long enough that a returning shopper finds their cart intact, typically days rather than hours for guests, and indefinitely for logged-in customers. Re-check stock and prices when they return so the cart never promises something you cannot deliver.
Should I use a slide-out mini-cart or a cart page?
Most stores benefit from both: a slide-out mini-cart to confirm additions without interrupting browsing, and a full cart page for editing and shipping estimates. Stores with simple, single-item purchases may skip the cart page and go straight to checkout.
Related Resources
Further reading: Cart and checkout usability research — Baymard Institute.

