Improved logic for putting products into cart