Adds an event handler that runs when the cart changes.
The event handler set by the onCartChange()
function runs when the cart changes.
The onCartChange()
event handler is triggered when:
refreshCart()
function is called.Important: Actions performed by Velo functions other than the refreshCart()
function do not trigger the onCartChange()
event handler.
handler(): void
The name of the function or the function expression to run when the cart is changed.