Group product by type