format cart, validation