The ticket office is on the right in the Old Guard House

Next to the Visitor Information office is the Edinburgh Castle shop
[Edinburgh Castle - Edinburgh - Scotland]