Skip to main content

Interface: AddToCartProps

Defined in: components/AddToCart.tsx:30

Properties

afterAddToCart?

optional afterAddToCart?: (cart, item?) => void

Defined in: components/AddToCart.tsx:107

Callback triggered after adding the product to cart.

Parameters

cart

Cart

item?

CartMainItem

Returns

void


allowIncrDecr?

optional allowIncrDecr?: boolean

Defined in: components/AddToCart.tsx:120

Renders − and + buttons beside the quantity input. Defaults to true.


beforeAddToCart?

optional beforeAddToCart?: () => boolean

Defined in: components/AddToCart.tsx:53

Called before adding to cart. Return false to abort (e.g. failed validation).

Returns

boolean


cartId?

optional cartId?: string

Defined in: components/AddToCart.tsx:44

Cart ID — required when onAddToCart is not provided


childItems?

optional childItems?: number[]

Defined in: components/AddToCart.tsx:50

IDs of the cluster child items, e.g. cluster options


className?

optional className?: string

Defined in: components/AddToCart.tsx:132

Additional CSS class for the root element


cluster?

optional cluster?: Cluster

Defined in: components/AddToCart.tsx:47

The cluster to be added to cart


companyId?

optional companyId?: number

Defined in: components/AddToCart.tsx:149

Active company ID from the company switcher. Overrides user's default company for cart creation and lookup.


configuration?

optional configuration?: object

Defined in: components/AddToCart.tsx:141

Configuration object passed to the component

imageSearchFiltersGrid?

optional imageSearchFiltersGrid?: MediaImageProductSearchInput

imageVariantFiltersSmall?

optional imageVariantFiltersSmall?: TransformationsInput

language?

optional language?: string

urls?

optional urls?: object

urls.getProductUrl

getProductUrl: (product, language?) => string

Parameters
product

Product

language?

string

Returns

string


createCart?

optional createCart?: boolean

Defined in: components/AddToCart.tsx:82

If true a new cart is created if no cart ID is provided. Defaults to false.


currency?

optional currency?: string

Defined in: components/AddToCart.tsx:38

Currency symbol used by the formatPrice helper for the success modal. Resolved from PropellerProvider when omitted; final fallback '€'.


display?

optional display?: AddToCartDisplay

Defined in: components/AddToCart.tsx:181

Display toggles. Equivalent flat props: allowIncrDecr, showModal, enableStockValidation.


enableStockValidation?

optional enableStockValidation?: boolean

Defined in: components/AddToCart.tsx:126

Validates available stock via InventoryService before adding. Defaults to false.


events?

optional events?: AddToCartEvents

Defined in: components/AddToCart.tsx:188

Event callbacks. Equivalent flat props: beforeAddToCart, onAddToCart, afterAddToCart, onCartCreated, onProceedToCheckout, onRequestQuoteClick.


graphqlClient?

optional graphqlClient?: GraphQLClient

Defined in: components/AddToCart.tsx:32

GraphQL client for the Propeller SDK. Resolved from PropellerProvider when omitted.


includeTax?

optional includeTax?: boolean

Defined in: components/AddToCart.tsx:156

When true, tax-inclusive price (net) is shown. When false, tax-exclusive price (gross) is shown. Defaults to false.


labels?

optional labels?: Record<string, string>

Defined in: components/AddToCart.tsx:76

Label overrides for UI strings

available labels:

  • outOfStock
  • noCartId
  • errorAdding
  • addedToCart
  • modalTitle
  • quantity
  • continueShopping
  • proceedToCheckout
  • requestQuoteButton
  • add
  • adding

language?

optional language?: string

Defined in: components/AddToCart.tsx:129

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


notes?

optional notes?: string

Defined in: components/AddToCart.tsx:56

Notes for the cart item


onAddToCart?

optional onAddToCart?: (product, clusterId?, quantity?, childItems?, notes?, price?, showModal?) => Cart

Defined in: components/AddToCart.tsx:94

Callback to handle adding the product to cart. If not provided the component calls CartService.addItemToCart internally.

Parameters

product

Product

clusterId?

number

quantity?

number

childItems?

CartChildItemInput[]

notes?

string

price?

number

showModal?

boolean

Returns

Cart


onCartCreated?

optional onCartCreated?: (cart) => void

Defined in: components/AddToCart.tsx:88

Callback to handle a new cart being created. WARNING: If not provided the component create new carts on every add-to-cart.

Parameters

cart

Cart

Returns

void


onProceedToCheckout?

optional onProceedToCheckout?: () => void

Defined in: components/AddToCart.tsx:135

Callback fired when the "Proceed to checkout" modal button is clicked

Returns

void


onRequestQuoteClick?

optional onRequestQuoteClick?: (cart) => void

Defined in: components/AddToCart.tsx:138

Callback fired when the "Request a Quote" modal button is clicked

Parameters

cart

Cart

Returns

void


price?

optional price?: number

Defined in: components/AddToCart.tsx:59

Custom price for the product (overrides calculated price)


priceComponent?

optional priceComponent?: ComponentType<PriceComponentProps>

Defined in: components/AddToCart.tsx:162


product

product: Product

Defined in: components/AddToCart.tsx:41

The product to be added to cart


showModal?

optional showModal?: boolean

Defined in: components/AddToCart.tsx:114

When true a modal popup is shown after a successful add-to-cart with buttons to continue shopping or proceed to checkout. Defaults to false (only a brief inline success message is shown).


stockComponent?

optional stockComponent?: ComponentType<StockComponentProps>

Defined in: components/AddToCart.tsx:169

Reserved slot. The success modal does not currently render stock — out-of-stock paths surface via a brief toast instead. Declared so consumers can pass it through uniformly; consumed if/when the modal gains a stock block in the future.


user?

optional user?: Contact | Customer | null

Defined in: components/AddToCart.tsx:35

The authenticated user (Contact or Customer). Resolved from PropellerProvider when omitted.