onCartChange( )


Adds an event handler that runs when the cart changes.

The event handler set by the onCartChange() function runs when the cart changes.

について onCartChange() event handler is triggered when:

  • The 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.
  • について refreshCart() function is called.

重要だ: Actions performed by Velo functions other than the refreshCart() function do not trigger the onCartChange() event handler.

メソッド宣言
コピー
メソッド・パラメータ
handlerfunctionRequired

handler(): void The name of the function or the function expression to run when the cart is changed.

役に立ちましたか?
はい
いいえ