Course in own window - Close window - How direct it to one spes. url

We have a course/test and customer open it from a web page.

The course/test is in a popup window.

After course/test, they have a button to buy a product on last page.

How can we close the course/test window and direct them to a specific url?

Now they just "came back" to the last page they open the course/test.

Discussions have been disabled for this post