If ingredient.price calculated `amount_to_buy * product.price` you could re-use the calculation.