No, they don't cost the same! 2700X is cheaper and comes with a CPU cooler, the 8700K is more expensive and you have to buy a CPU cooler! Here is a picture and links to the prices!
And here we go again, quoting pricing from one store and claiming that one chip is more expensive than other as if that is an universal truth. Do I need again to give prices from another store (one relevant to me) where the 2700X (324.90€) is more expensive than the 8700K (314.90€)?
Technically, the 8700K is still more expensive since you have to buy a CPU cooler for it as well!
Unless you have already one, but that wasn't the point.
No, the point is that the 2700X is actually cheaper total cost of ownership for anyone who doesn't have spare 8700K CPU cooler buying from the store you posted in your country. But here in America and I assume most other countries MSRP on the 8700K is still higher and doesn't come with a CPU cooler!