Przejdź do głównej zawartości

Interface: AddToCartButtonProps

Extends​

  • ButtonProps

Properties​

attributes?​

optional attributes?: CartLineAttribute[]

Cart line attributes (custom options, gift wrap, etc.).


children?​

optional children?: ReactNode

Button label / contents. Defaults to "Add to cart".

Overrides​

ButtonProps.children


onError?​

optional onError?: (error) => void

Called when the mutation throws (does not bubble through React Error Boundary).

Parameters​

error​

Error

Returns​

void


onSuccess?​

optional onSuccess?: (result) => void

Called after the mutation succeeds with the updated cart summary.

Parameters​

result​
cartId​

string

totalQuantity​

number

Returns​

void


quantity?​

optional quantity?: number

Quantity (default 1).


variantId​

variantId: string

Product variant identifier to add.