Skip to main content

Interface: CartIconAndSidebarProps

Defined in: components/CartIconAndSidebar.tsx:19

Properties

afterRequestAuthorization?

optional afterRequestAuthorization?: (cart) => void

Defined in: components/CartIconAndSidebar.tsx:113

Fires after a successful purchase authorization request with the updated cart

Parameters

cart

Cart

Returns

void


cart

cart: Cart

Defined in: components/CartIconAndSidebar.tsx:24

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:134


cartCheckoutButton?

optional cartCheckoutButton?: boolean

Defined in: components/CartIconAndSidebar.tsx:66

Show checkout button in cart sidebar for immediate checkout.

Default

true

cartItemComponent?

optional cartItemComponent?: ComponentType<CartItemProps>

Defined in: components/CartIconAndSidebar.tsx:132

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.


cartPageButton?

optional cartPageButton?: boolean

Defined in: components/CartIconAndSidebar.tsx:77

Show shopping cart page button in cart sidebar.

Default

true

cartSidebarTitle?

optional cartSidebarTitle?: string

Defined in: components/CartIconAndSidebar.tsx:60

Title for the shopping cart sidebar.

Default

'Shopping cart'

companyId?

optional companyId?: number

Defined in: components/CartIconAndSidebar.tsx:101

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


configuration?

optional configuration?: any

Defined in: components/CartIconAndSidebar.tsx:95

Configuration object passed to the component


graphqlClient?

optional graphqlClient?: GraphQLClient

Defined in: components/CartIconAndSidebar.tsx:107

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


icon?

optional icon?: string

Defined in: components/CartIconAndSidebar.tsx:30

Icon for the cart icon in header.

Default

'default-cart-icon'

iconClassName?

optional iconClassName?: string

Defined in: components/CartIconAndSidebar.tsx:119

  • Additional class name for the shopping cart icon.

labels?

optional labels?: Record<string, string>

Defined in: components/CartIconAndSidebar.tsx:89

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


language?

optional language?: string

Defined in: components/CartIconAndSidebar.tsx:98

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


onCartIconClick?

optional onCartIconClick?: (cart) => void

Defined in: components/CartIconAndSidebar.tsx:54

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:82

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:71

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:116

Error handler for authorization request failures

Parameters

error

Error

Returns

void


onRequestAuthorization?

optional onRequestAuthorization?: (cart) => void

Defined in: components/CartIconAndSidebar.tsx:110

Override the internal request purchase authorization call

Parameters

cart

Cart

Returns

void


onRequestQuoteClick?

optional onRequestQuoteClick?: (cart) => void

Defined in: components/CartIconAndSidebar.tsx:104

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:36

Shows item count badge on the cart icon.

Default

true

showCartSidebarOnClick?

optional showCartSidebarOnClick?: boolean

Defined in: components/CartIconAndSidebar.tsx:49

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:42

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

Default

false

sidebarClassName?

optional sidebarClassName?: string

Defined in: components/CartIconAndSidebar.tsx:122

  • Additional class name for the shopping cart sidebar.

user?

optional user?: Contact | Customer

Defined in: components/CartIconAndSidebar.tsx:92

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