The ratio of the number of chocolates to the number of sweets that John bought was 2: 7. The cost of a chocolate was $1.70 more than the cost of a sweet. He paid $299.60 for the chocolates and sweets. If the total cost of the sweets was $92.40 more than the total cost of chocolates, how many chocolates and sweets did John buy altogether?

Let's say the cost of a chocolate was c dollars.

The cost of a sweet was c - $1.70 dollars.
The total cost of chocolates that John bought is 2c.
The total cost of sweets that John bought is 7c - 7*$1.70 = 7c - $11.90.
The total cost of chocolates and sweets that John bought is 2c + (7c - $11.90) = 2c + 7c - $11.90 = 9c - $11.90.
The total cost of chocolates and sweets is equal to $299.60, so we have 9c - $11.90 = $299.60.
Adding $11.90 to both sides, we get 9c = $299.60 + $11.90 = $311.50.
Dividing both sides by 9, we get c = $311.50 / 9 = $34.61.
The total cost of sweets that John bought is 7c - $11.90 = 7*$34.61 - $11.90 = $242.27 - $11.90 = $230.37.
The total number of chocolates and sweets that John bought is 2 + 7 = <<2+7=9>>9.
The total number of chocolates and sweets that John bought is also the sum of the ratios, which is 2 + 7 = <<2+7=9>>9.
Since 9 chocolates and sweets cost $299.60, the cost of each chocolate and sweet is $299.60 / 9 = $33.29.
The cost of all the chocolates and sweets that John bought is $33.29 * 9 = $299.61. Answer: \boxed{9}.

Let's break down the information given step-by-step:

Step 1: Establish the ratio between chocolates and sweets.
The ratio of chocolates to sweets that John bought is given as 2:7.

Step 2: Determine the difference in cost between a chocolate and a sweet.
The cost of a chocolate is $1.70 more than the cost of a sweet.

Step 3: Calculate the total cost of chocolates.
The total cost of chocolates is given as $299.60.

Step 4: Calculate the total cost of sweets.
The total cost of sweets is $92.40 more than the total cost of chocolates.

Step 5: Determine the number of chocolates and sweets John bought altogether.

Let's solve this step-by-step:

Step 1: Establish the ratio between chocolates and sweets.
The ratio between chocolates and sweets is 2:7, which also means that for every 2 parts of chocolates, there are 7 parts of sweets.

Step 2: Determine the difference in cost between a chocolate and a sweet.
Let's assume the cost of a sweet is 'x' dollars.
Therefore, the cost of a chocolate is 'x + 1.70' dollars.

Step 3: Calculate the total cost of chocolates.
The total cost of chocolates is given as $299.60.
Since the ratio of chocolates to sweets is 2:7, we can calculate the cost of 2 parts of chocolates as:
2 * (x + 1.70) = 299.60

Simplifying the equation:
2x + 3.4 = 299.60
2x = 296.20
x = 148.10

So, the cost of a sweet is $148.10.

Step 4: Calculate the total cost of sweets.
The total cost of sweets is $92.40 more than the total cost of chocolates.
Since the ratio of chocolates to sweets is 2:7, we can calculate the cost of 7 parts of sweets as:
7 * x = 7 * 148.10 = $1036.70

So, the total cost of sweets is $1036.70.

Step 5: Determine the number of chocolates and sweets John bought altogether.
To find the number of chocolates and sweets, we need to find the number of parts in the ratio.

The number of parts in the ratio (2 + 7) = 9.

To find the number of chocolates John bought:
Number of chocolates = (2/9) * 9 = 2 parts

To find the number of sweets John bought:
Number of sweets = (7/9) * 9 = 7 parts

Therefore, John bought 2 chocolates and 7 sweets altogether.