Skip to main content

Interface: CartIconAndSidebarProps

Defined in: components/CartIconAndSidebar.tsx:20

Properties

afterRequestAuthorization?

optional afterRequestAuthorization?: (cart) => void

Defined in: components/CartIconAndSidebar.tsx:125

Fires after a successful purchase authorization request with the updated cart

Parameters

cart

Cart

Returns

void


cart

cart: Cart

Defined in: components/CartIconAndSidebar.tsx:25

Shopping cart that this component will operate with. Should be passed from a cart state.


cartBonusItemsComponent?

optional cartBonusItemsComponent?: ComponentType<CartBonusItemsProps>

Defined in: components/CartIconAndSidebar.tsx:146


cartBonusItemsLabels?

optional cartBonusItemsLabels?: Record<string, string>

Defined in: components/CartIconAndSidebar.tsx:101

Labels for the bonus-items block. Keys: title, sku.


cartCheckoutButton?

optional cartCheckoutButton?: boolean

Defined in: components/CartIconAndSidebar.tsx:67

Show checkout button in cart sidebar for immediate checkout.

Default

true

cartItemComponent?

optional cartItemComponent?: ComponentType<CartItemProps>

Defined in: components/CartIconAndSidebar.tsx:144

Replaces each cart row rendered inside the drawer with a custom CartItem. The drawer composes CartItem with cardFrame=false, showDelete=false, readOnlyQuantity, and onTitleClick wired to close the sidebar — any consumer-supplied replacement receives these variant props plus the cart data.


cartItemLabels?

optional cartItemLabels?: Record<string, string>

Defined in: components/CartIconAndSidebar.tsx:98

Labels forwarded to the inner CartItem rows (e.g. qtyPrefix). Without this the sidebar's line items fell back to English ("Qty:") even on a localized page. Keys match CartItem's label map.


cartPageButton?

optional cartPageButton?: boolean

Defined in: components/CartIconAndSidebar.tsx:78

Show shopping cart page button in cart sidebar.

Default

true

cartSidebarTitle?

optional cartSidebarTitle?: string

Defined in: components/CartIconAndSidebar.tsx:61

Title for the shopping cart sidebar.

Default

'Shopping cart'

companyId?

optional companyId?: number

Defined in: components/CartIconAndSidebar.tsx:113

Active company ID — used to look up the user's PAC for this company


configuration?

optional configuration?: any

Defined in: components/CartIconAndSidebar.tsx:107

Configuration object passed to the component


graphqlClient?

optional graphqlClient?: GraphQLClient

Defined in: components/CartIconAndSidebar.tsx:119

GraphQL client — used for internal CartService calls (e.g. purchase authorization)


icon?

optional icon?: string

Defined in: components/CartIconAndSidebar.tsx:31

Icon for the cart icon in header.

Default

'default-cart-icon'

iconClassName?

optional iconClassName?: string

Defined in: components/CartIconAndSidebar.tsx:131

  • Additional class name for the shopping cart icon.

labels?

optional labels?: Record<string, string>

Defined in: components/CartIconAndSidebar.tsx:91

Labels for the component. Available keys: cartIconLabel, totalLabel, itemsLabel, emptyCart, continueShopping, qty, total, totalExclVat, checkoutButton, cartPageButton, closeLabel


language?

optional language?: string

Defined in: components/CartIconAndSidebar.tsx:110

Language code passed to CartService operations. Defaults to 'en'.


onCartIconClick?

optional onCartIconClick?: (cart) => void

Defined in: components/CartIconAndSidebar.tsx:55

Fires a click event when showCartSidebarOnClick is set to false.

Parameters

cart

Cart

Returns

void


onCartPageButtonClick?

optional onCartPageButtonClick?: (cart) => void

Defined in: components/CartIconAndSidebar.tsx:83

Fires a click event when the shopping cart button in the sidebar is clicked.

Parameters

cart

Cart

Returns

void


onCheckoutButtonClick?

optional onCheckoutButtonClick?: (cart) => void

Defined in: components/CartIconAndSidebar.tsx:72

Fires a click event when the checkout button in the sidebar is clicked.

Parameters

cart

Cart

Returns

void


onError?

optional onError?: (error) => void

Defined in: components/CartIconAndSidebar.tsx:128

Error handler for authorization request failures

Parameters

error

Error

Returns

void


onRequestAuthorization?

optional onRequestAuthorization?: (cart) => void

Defined in: components/CartIconAndSidebar.tsx:122

Override the internal request purchase authorization call

Parameters

cart

Cart

Returns

void


onRequestQuoteClick?

optional onRequestQuoteClick?: (cart) => void

Defined in: components/CartIconAndSidebar.tsx:116

Callback fired when "Request a Quote" is clicked in the sidebar. Only shown for contacts when prop is provided.

Parameters

cart

Cart

Returns

void


showBadge?

optional showBadge?: boolean

Defined in: components/CartIconAndSidebar.tsx:37

Shows item count badge on the cart icon.

Default

true

showCartSidebarOnClick?

optional showCartSidebarOnClick?: boolean

Defined in: components/CartIconAndSidebar.tsx:50

Show cart sidebar at the right side of the screen when cart icon is clicked. If false it will fire onCartIconClick() instead.

Default

true

showTotals?

optional showTotals?: boolean

Defined in: components/CartIconAndSidebar.tsx:43

Shows the totals of the shopping cart beneath the icon when hovered.

Default

false

sidebarClassName?

optional sidebarClassName?: string

Defined in: components/CartIconAndSidebar.tsx:134

  • Additional class name for the shopping cart sidebar.

user?

optional user?: Contact | Customer

Defined in: components/CartIconAndSidebar.tsx:104

Logged-in user — used to determine purchaser role and authorization limit