The cart and checkout experience in Floralé is intentionally simple: customers build a cart on the site, fill in four order detail fields, and send everything to Floralé’s WhatsApp number as a pre-formatted message. There is no payment gateway — the order is confirmed by WhatsApp and secured with a 50% deposit. This page explains the cart page (Documentation Index
Fetch the complete documentation index at: https://mintlify.com/dlampatricio/florale/llms.txt
Use this file to discover all available pages before exploring further.
/carrito), the CartDrawer accessible from every page, the Zustand store that persists cart state, and the generateWhatsAppMessage utility that assembles the final message.
Floralé does not process payments online. All orders are coordinated via WhatsApp at
+598 93 705 133. A 50% deposit is required to confirm the order, and items are prepared 24–48 hours before the agreed delivery date.Cart page UI (/carrito)
The /carrito page is a 'use client' component. On mount it calls getProducts() to resolve product details from the productId references stored in the Zustand cart, then renders two columns on desktop: a scrollable item list on the left and a sticky order summary panel on the right.
Item list
Each cart row shows:Product thumbnail
A 96 × 96 px square image (linked to the product detail page) rendered with
ImageWithSkeleton for a smooth load.Name & unit price
Product name (linked to
/producto/{id}) and unit price formatted in UYU via formatPrice().Quantity controls
− and + buttons that call updateQuantity(productId, qty). Setting quantity to 0 removes the item automatically.Line total
price × quantity displayed in the terracotta accent colour beside the quantity control.removeItem(productId) and shows a toast) and a collapsible per-item note field — a plain text input that persists in the cart store via updateNote(productId, note).
Order summary panel
The right-hand panel islg:sticky lg:top-24 so it stays visible while the customer scrolls through a long item list. It contains:
- An itemized list —
product.name × qtyand the line total for each item. - A horizontal rule followed by the total in UYU (
formatPrice(total)). - The order details form (see below).
- The WhatsApp checkout button.
Order details form
Before the checkout button becomes functional, the customer must complete four fields. All four are required — attempting to submit with any field empty fires a toast notification and aborts the checkout.De (sender name)
Free-text input. Bound to
sender state — the name of the person placing the order.Para (recipient name)
Free-text input. Bound to
recipient state — the name of the person receiving the gift.Fecha de entrega
A
DatePicker component. Bound to deliveryDate state — the desired delivery date as a string.Modalidad
A toggle between Envío (delivery, with additional cost) and Retiro (free in-store pickup). Bound to
deliveryMethod state.WhatsApp checkout
When all four order detail fields are filled, clicking Enviar pedido por WhatsApp callshandleCheckout:
Validate fields
if (!sender || !recipient || !deliveryDate || !deliveryMethod) → show toast and return early.Build the message
generateWhatsAppMessage(cartProducts, total, { sender, recipient, date: deliveryDate, method: deliveryMethod }) returns a formatted plain-text string.generateWhatsAppMessage
ThegenerateWhatsAppMessage function in lib/utils.ts builds the pre-filled WhatsApp message from the cart and delivery details:
CartDrawer
TheCartDrawer component is mounted in the site-wide layout so it’s accessible from every page — customers can review and adjust their cart without leaving the catalog or a product detail page.
× button calls closeDrawer(). When items are present a WhatsAppButton appears at the bottom of the drawer as a quick path to /carrito for the full checkout form.
Opening the drawer
Any component can open the drawer by callingopenDrawer() or toggleDrawer() from the cart store. The cart icon in the site Header is a <Link> that navigates directly to /carrito; the drawer is opened programmatically by whichever component calls openDrawer():
Zustand cart store
The cart state is managed byuseCartStore, a Zustand store created with the persist middleware. It is defined in lib/cart-store.ts.
Store actions
Adds a new item with
quantity (default 1) and an empty note. If the product is already in the cart, increments its quantity instead.Removes the item with the given
productId entirely from the cart.Sets the item’s quantity to the given value. Passing
0 or a negative number removes the item automatically.Updates the per-item note string. The note appears in the WhatsApp message prefixed with ✏️.
Empties all items from the cart. Typically called after a successful checkout.
Controls the
isDrawerOpen boolean that drives the CartDrawer visibility. isDrawerOpen is not persisted to localStorage.localStorage persistence
Thepersist middleware serializes only the items array (via partialize) to localStorage under the key florale-cart. The isDrawerOpen flag is excluded so the drawer is always closed on a fresh page load.
Empty cart state
Whenitems.length === 0, the cart page shows a centred empty-state illustration with a link back to /catalogo: