Interface: AddToCartButtonProps
Extends
ButtonProps
Properties
attributes?
optionalattributes?:CartLineAttribute[]
Cart line attributes (custom options, gift wrap, etc.).
children?
optionalchildren?:ReactNode
Button label / contents. Defaults to "Add to cart".
Overrides
ButtonProps.children
onError?
optionalonError?: (error) =>void
Called when the mutation throws (does not bubble through React Error Boundary).
Parameters
error
Error
Returns
void
onSuccess?
optionalonSuccess?: (result) =>void
Called after the mutation succeeds with the updated cart summary.
Parameters
result
cartId
string
totalQuantity
number
Returns
void
quantity?
optionalquantity?:number
Quantity (default 1).
variantId
variantId:
string
Product variant identifier to add.