Calculating Course cost per student
Is this value stored on the Register Content Type?

You can use the computed_field module.

You will need to read every value in ref_to_course field. Load each of those nodes. From there, read the course_cost and add the values.

Then store the values on the computed field.



Another option is using views module. You can attach a View to the content type. The view can then use the node NID, read the ref_to_course. Add relationship, read the course_cost and add those.



I think the first might be better since you calculate it once.