Value from cart is 0 - no address input

Hello everyone,

I am new to programming plugins and want to do the following:

I offer streaming services. Some of them are free and for these free ones the user should only enter his name and email.

I do not get it done that I get to see only the two fields at checkout here and when submitting this something is stored in the database incl. the item or the ID of the item.

If the course is paid, then the normal checkout will go through.

Can anyone help me here? I was thinking of a StoreFrontController that would hook in and display one thing or another to me accordingly after querying the cart value. Here I have called a template which overwrites the block of the checkout for me.

Would this be the right approach? Can someone help me here?