If your friend already bought the item, you would ask:
How much did it cost?
Do you mind telling me how much did it cost?
Here is an indirect way to ask...
"Wow! So nice... It must have been expensive! "
Most people would answer: "No, it was only $xx" (only if it was not expensive.)
But if it was expensive, your friend may not feel like saying the price unless prompted again:
You could indirectly ask... "I hope it wasn't too expensive...?" (ask it like a question :)
Just some ideas :)