Interface: AddToCartProps
Defined in: components/AddToCart.tsx:32
Properties
afterAddToCart?
optionalafterAddToCart?: (cart,item?) =>void
Defined in: components/AddToCart.tsx:109
Callback triggered after adding the product to cart.
Parameters
cart
Cart
item?
CartMainItem
Returns
void
allowIncrDecr?
optionalallowIncrDecr?:boolean
Defined in: components/AddToCart.tsx:122
Renders − and + buttons beside the quantity input. Defaults to true.
beforeAddToCart?
optionalbeforeAddToCart?: () =>boolean
Defined in: components/AddToCart.tsx:55
Called before adding to cart. Return false to abort (e.g. failed validation).
Returns
boolean
bonusItemsLabels?
optionalbonusItemsLabels?:Record<string,string>
Defined in: components/AddToCart.tsx:140
Labels for the bonus-items block in the success modal.
Keys: title ('Bonus items'), sku ('SKU').
cartId?
optionalcartId?:string
Defined in: components/AddToCart.tsx:46
Cart ID — required when onAddToCart is not provided
childItems?
optionalchildItems?:number[]
Defined in: components/AddToCart.tsx:52
IDs of the cluster child items, e.g. cluster options
className?
optionalclassName?:string
Defined in: components/AddToCart.tsx:134
Additional CSS class for the root element
cluster?
optionalcluster?:Cluster
Defined in: components/AddToCart.tsx:49
The cluster to be added to cart
companyId?
optionalcompanyId?:number
Defined in: components/AddToCart.tsx:157
Active company ID from the company switcher. Overrides user's default company for cart creation and lookup.
configuration?
optionalconfiguration?:object
Defined in: components/AddToCart.tsx:149
Configuration object passed to the component
imageSearchFiltersGrid?
optionalimageSearchFiltersGrid?:MediaImageProductSearchInput
imageVariantFiltersSmall?
optionalimageVariantFiltersSmall?:TransformationsInput
language?
optionallanguage?:string
urls?
optionalurls?:object
urls.getProductUrl
getProductUrl: (
product,language?) =>string
Parameters
product
Product
language?
string
Returns
string
createCart?
optionalcreateCart?:boolean
Defined in: components/AddToCart.tsx:84
If true a new cart is created if no cart ID is provided. Defaults to false.
currency?
optionalcurrency?:string
Defined in: components/AddToCart.tsx:40
Currency symbol used by the formatPrice helper for the success modal. Resolved from PropellerProvider when omitted; final fallback '€'.
display?
optionaldisplay?:AddToCartDisplay
Defined in: components/AddToCart.tsx:189
Display toggles. Equivalent flat props: allowIncrDecr, showModal,
enableStockValidation.
enableStockValidation?
optionalenableStockValidation?:boolean
Defined in: components/AddToCart.tsx:128
Validates available stock via InventoryService before adding. Defaults to false.
events?
optionalevents?:AddToCartEvents
Defined in: components/AddToCart.tsx:196
Event callbacks. Equivalent flat props: beforeAddToCart, onAddToCart,
afterAddToCart, onCartCreated, onProceedToCheckout,
onRequestQuoteClick.
graphqlClient?
optionalgraphqlClient?:GraphQLClient
Defined in: components/AddToCart.tsx:34
GraphQL client for the Propeller SDK. Resolved from PropellerProvider when omitted.
includeTax?
optionalincludeTax?:boolean
Defined in: components/AddToCart.tsx:164
When true, tax-inclusive price (net) is shown. When false, tax-exclusive price (gross) is shown. Defaults to false.
labels?
optionallabels?:Record<string,string>
Defined in: components/AddToCart.tsx:78
Label overrides for UI strings
available labels:
- outOfStock
- noCartId
- errorAdding
- addedToCart
- modalTitle
- quantity
- continueShopping
- proceedToCheckout
- requestQuoteButton
- add
- adding
language?
optionallanguage?:string
Defined in: components/AddToCart.tsx:131
Language code passed to CartService operations. Defaults to 'en'.
notes?
optionalnotes?:string
Defined in: components/AddToCart.tsx:58
Notes for the cart item
onAddToCart?
optionalonAddToCart?: (product,clusterId?,quantity?,childItems?,notes?,price?,showModal?) =>Cart|Promise<Cart>
Defined in: components/AddToCart.tsx:96
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?
optionalonCartCreated?: (cart) =>void
Defined in: components/AddToCart.tsx:90
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?
optionalonProceedToCheckout?: () =>void
Defined in: components/AddToCart.tsx:143
Callback fired when the "Proceed to checkout" modal button is clicked
Returns
void
onRequestQuoteClick?
optionalonRequestQuoteClick?: (cart) =>void
Defined in: components/AddToCart.tsx:146
Callback fired when the "Request a Quote" modal button is clicked
Parameters
cart
Cart
Returns
void
price?
optionalprice?:number
Defined in: components/AddToCart.tsx:61
Custom price for the product (overrides calculated price)
priceComponent?
optionalpriceComponent?:ComponentType<PriceComponentProps>
Defined in: components/AddToCart.tsx:170
product
product:
Product
Defined in: components/AddToCart.tsx:43
The product to be added to cart
showModal?
optionalshowModal?:boolean
Defined in: components/AddToCart.tsx:116
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?
optionalstockComponent?:ComponentType<StockComponentProps>
Defined in: components/AddToCart.tsx:177
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?
optionaluser?:Contact|Customer|null
Defined in: components/AddToCart.tsx:37
The authenticated user (Contact or Customer). Resolved from PropellerProvider when omitted.