Skip to content

CartChangesNotice

What changed in the cart since the buyer last looked, at the top of the cart: sold-out lines, price changes against the price at the time of adding, lowered quantities, and lines an engine removed. useCartChanges acknowledges them, so the notice shows once.

import { CartChangesNotice } from "@evolve-storefront/feature-cart/cart-changes";

Renders inside CartProvider.

Preview

DefaultOpen in Storybook ↗

Usage

Each kind of change in the buyer's words.

const { data } = useCartChanges();
<CartChangesNotice changes={data?.changes} />
<Cart cart={cart} changes={data?.changes} />
<CartUnavailableLines lines={data?.unavailableLineItems} onRemove={(line) => remove(line.id)} />

Props

PropTypeDescription
changesCartLineChange[] | undefined

From useCartChanges; nothing renders without any.

vatDisplay?VatDisplay
headingLevel?HeadingLevel

Any other props go to the root element, like on a plain HTML element.