Hi!, I need to be able to register to the change in the subtotal of an order in the shopping cart. e.g: The customer adds or removes items from cart, and I need to register to that events in order to get the last updated order subtotal. So far the only 2 ways we have come out with to implement this are:
- Implement a mutation observer on the html tag that contains the subtotal value (here we don’t think it’s the best because we don’t know if all themes use the same class name for that html tag).
- Intercept the Ajax request generated when a product is added or removed from the cart (we don’t think this is the best because we don’t know if all the carts in all themes have the same update mechanism or if they all use Ajax during the update).
Do you know any better method that does not depend on store’s theme implementation?