Skip to main content

Interface: AddToCartProps

Defined in: components/AddToCart.tsx:34

Properties​

afterAddToCart?​

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

Defined in: components/AddToCart.tsx:111

Callback triggered after adding the product to cart.

Parameters​

cart​

Cart

item?​

CartMainItem

Returns​

void


allowIncrDecr?​

optional allowIncrDecr?: boolean

Defined in: components/AddToCart.tsx:124

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


beforeAddToCart?​

optional beforeAddToCart?: () => boolean

Defined in: components/AddToCart.tsx:57

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

Returns​

boolean


bonusItemsLabels?​

optional bonusItemsLabels?: Record<string, string>

Defined in: components/AddToCart.tsx:142

Labels for the bonus-items block in the success modal. Keys: title ('Bonus items'), sku ('SKU').


cartId?​

optional cartId?: string

Defined in: components/AddToCart.tsx:48

Cart ID — required when onAddToCart is not provided


childItems?​

optional childItems?: number[]

Defined in: components/AddToCart.tsx:54

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


className?​

optional className?: string

Defined in: components/AddToCart.tsx:136

Additional CSS class for the root element


cluster?​

optional cluster?: Cluster

Defined in: components/AddToCart.tsx:51

The cluster to be added to cart


companyId?​

optional companyId?: number

Defined in: components/AddToCart.tsx:159

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

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

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

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

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


enableStockValidation?​

optional enableStockValidation?: boolean

Defined in: components/AddToCart.tsx:130

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


events?​

optional events?: AddToCartEvents

Defined in: components/AddToCart.tsx:198

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


graphqlClient?​

optional graphqlClient?: GraphQLClient

Defined in: components/AddToCart.tsx:36

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


includeTax?​

optional includeTax?: boolean

Defined in: components/AddToCart.tsx:166

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

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

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


notes?​

optional notes?: string

Defined in: components/AddToCart.tsx:60

Notes for the cart item


onAddToCart?​

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

Defined in: components/AddToCart.tsx:98

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 | Promise<Cart>


onCartCreated?​

optional onCartCreated?: (cart) => void

Defined in: components/AddToCart.tsx:92

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

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

Returns​

void


onRequestQuoteClick?​

optional onRequestQuoteClick?: (cart) => void

Defined in: components/AddToCart.tsx:148

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

Custom price for the product (overrides calculated price)


priceComponent?​

optional priceComponent?: ComponentType<PriceComponentProps>

Defined in: components/AddToCart.tsx:172


product​

product: Product

Defined in: components/AddToCart.tsx:45

The product to be added to cart


showModal?​

optional showModal?: boolean

Defined in: components/AddToCart.tsx:118

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

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

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