onCartChange( )


Triggered when a cart changes.

Triggered when:

  • A cart is modified by native UI elements such as the 'Add to Cart' button, increase (+) and decrease (-) item quantity buttons, remove line item button (x), etc.
  • The refreshCart() method is called.

Note: Actions performed by any method other than refreshCart() don't trigger onCartChange().

Method Declaration
Copy
Method Parameters
handlerfunctionRequired

handler(): void The method to run when the cart changes.

Errors

This method doesn't return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?