Essential React hooks for accessing checkout data and building dynamic components that respond to customer actions
import { useCheckoutSession } from '@ollie-shop/sdk'; export default function CartSummary() { const { cart, customer, addToCart, removeFromCart } = useCheckoutSession(); return ( <div> <h3>Hello {customer.firstName}!</h3> <p>Items: {cart.items.length}</p> <p>Total: ${(cart.total / 100).toFixed(2)}</p> {cart.items.map(item => ( <div key={item.id}> <span>{item.name} (${(item.price / 100).toFixed(2)})</span> <button onClick={() => removeFromCart(item.id)}>Remove</button> </div> ))} </div> ); }