'Adding a line of custom text per cart item in Woocommerce in the cart

I have a client who has collecting the names of people booking courses through their Woocommerce installation. The users currently use a free text block in the cart to list the people that will be attending the course, but at the moment there is nothing to stop a client from booking one place and entering as many names as they wish.

Is there a simple way to tie the number of text fields to the quantity of items in the cart, hopefully to cut down on this practice.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source