Please add a shipping address
; } if (!session.payment?.selectedPayments?.length) { returnPlease select a payment method
; } return ; } ``` ### **Displaying cart totals** ```typescript theme={"system"} function CartSummary() { const { session } = useCheckoutSession(); const { totals, locale } = session; return (Items: {session.cartItems.length}
Total: {formatPrice(session.totals.items || 0)}
{session.cartItems.map((item) => (Coupon input is opened by default
)}Your order #{order.id} has been placed.
Total: {formatCurrency(totals.total, fulfillment.locale.currency)}
Total Items: {session.cartItems.length}
Subtotal: ${session.totals.items}
{(session.totals.discounts ?? 0) > 0 && (Discounts: -${session.totals.discounts}
)}Shipping: ${session.totals.shipping ?? 0}
Total: ${session.totals.total}
Add {format(remaining)} for free shipping
Cart total: ${(session.totals.total / 100).toFixed(2)}
Total: {session.totals.total}
; } ``` ### In GTM Custom HTML Tags Access the global objects directly in [GTM Custom HTML tags](/ollie-shop/analytics/gtm-enrichment): ```html theme={"system"} ``` ## Related * [useCheckoutSession Hook](/ollie-shop/api/useCheckoutSession) — React hook for accessing session data * [Enriching Events with GTM](/ollie-shop/analytics/gtm-enrichment) — Use session data in GTM tags # Slots Source: https://docs.ollie.shop/ollie-shop/concepts/slots Strategic placement points where components transform your checkout experience Slots are predefined blocks that structure a [Template](https://docs.ollie.shop/ollie-shop/concepts/templates) in Ollie Shop. Each slot is filled with a native component by default, but you can easily replace it with your own — no need to rebuild your entire checkout. This modular approach lets you customize specific parts of the checkout experience while maintaining speed and stability. To learn how to use Slots to iterate and improve your checkout, check out [Versions](https://docs.ollie.shop/ollie-shop/concepts/version).{missing > 0 ? `You are ${format(missing)} away from receiving Free Shipping` : "🎉 Congratulations, you have received free shipping!"}
{missing > 0 ? `You are ${format(missing)} away from receiving Free Shipping` : "🎉 Congratulations, you have received free shipping!"}
{item.originalPrice}
{item.price}
{item.price}
)}{formatPrice(item.originalPrice)}
{formatPrice(item.price)}
{formatPrice(item.price)}
)}{formatPrice(item.originalPrice)}
{formatPrice(item.price)}
{formatPrice(item.price)}
)}Pay in 3 interest-free installments with your card. You'll be redirected to complete the payment, so please don't close the page.{" "} Terms & conditions
> ); } ``` ### 2. Add meta.json Point the component at the slot id. `meta.json` only needs the slot plus the required identifiers: ```json theme={"system"} // components/PaymentInstallmentNotice/meta.json { "name": "payment-installment-notice", "version": "1.0.0", "slot": "payment_pay_in_installments_203_content", "id": "2893c0fc-1872-4a59-be2a-dba92d7a54f5" } ``` The `slot` must match the id you built from the method's name and id. ### 3. Deploy Deploy the component from **Studio**. Once the build succeeds, the component renders whenever that payment method is selected in the checkout. See [Studio](./studio-editor.mdx) for the deploy flow. ## Styling Style your component with a CSS module and the checkout's CSS variables so it follows the active theme: ```css theme={"system"} /* components/PaymentInstallmentNotice/index.module.css */ .notice { margin-top: 1rem; font-size: 0.875rem; color: var(--color-secondary, #666); } .notice a { color: var(--color-primary); text-decoration: underline; } ``` ## TroubleshootingSession ID: {session.id}
Cart has {session.cartItems.length} items