Reformat cart.js and add trigger after cart update