I was there a few weeks back - not sure about buying in advance, sorry.
There is visitor centre where bookings for Knowth and or Newgrange are made, in fact you can only access the two sites from here as you are bused there and back from the centre. €11 for an adult to vist the centre (not sure if this free anyway) and the two sites.
Try to get there early as numbers are restricted on each trip to the sites
Contact number for the centre is 041 9823071.
Well worth a visit, while in the neighbour hood you should check out the Battle of the Boyne visitor centre and Dowth as well.