Add an input field to the product view How do I add input fields to the commerce products (in Drupal 8) in order to save the information of those fields when the user purchases the product?

For example, if I want to sell t-shirts I would like an extra field to add some text and print it in the t-shirt.
Instead of adding the field to the product, consider adding the field to order items.

Then make it available in 'manage form display' -> 'add to cart'.

in Drupal 7 this functionality was provided by Commerce customizable Products module, now it has been moved into Commerce 2.x itself.