Moved cart preview logic into cart.js