When extending the cart view, when any values like quantity or cart add/remove is happening and we need to update any values in the cart according to the change we can use the following code: This function will run every time an update happened in the model