Skip to main content

Shipping summary component

Introduction

ShippingSummary is a Livewire component that shows a concise overview of the customer's chosen delivery method and, when required, the shipping address or recipient name. It mirrors the design of the checkout sidebar in Figma and updates automatically when other checkout components emit events.

Public properties

PropertyTypeDescription
$carrierIdint|nullCurrent shipping carrier ID. When null, no carrier is selected.
$currentCurrencystringISO currency code used for price formatting.

Note shippingType is no longer passed as a public property—the component derives the type (delivery vs warehouse) from the selected carrier.

Listeners

EventMethodPayload
setCarrierIdupdateCarrierId`int

Browser events emitted

EventPurpose
accordion-openOpens the corresponding accordion (e.g., Shipping Method or Shipping Address) so the user can make edits.

Computed properties (getters)

GetterReturnsPurpose
isDeliverybooltrue when the carrier type equals delivery.
isWarehousebooltrue when the carrier type equals warehouse.
shippingTypeLabel`stringnull`
recipientName`stringnull`
hasCompleteAddressDataboolIndicates whether all required address fields are present.
formattedShippingAddressString`stringnull`

Usage

@livewire('cart.shipping-summary', [
'carrierId' => $checkout->carrierId,
'currentCurrency' => $currentCurrency,
])

Accessibility

  • The component uses ARIA live regions (aria-live="polite") to announce real-time updates.
  • All action buttons include descriptive aria-labels sourced from accessibility.php translations.
  • PHP class: app/Http/Livewire/Cart/ShippingSummary.php
  • View: resources/views/livewire/cart/shipping-summary.blade.php
  • Shared trait: app/Http/Livewire/Cart/Traits/ShippingDataHelper.php

Updated for Laravel 10, Livewire 2, Alpine 2, and Tailwind 3.

X

Graph View