The code generated works only on the Shopify Free themes: Dawn, Sense, Craft, Taste, Ride, Studio,
Origin, Refresh,
Publisher and Spotlight.
If you have a premium theme, you can contact me and I will help you implement any field you need on your specific theme.
Please remove the buy it now button since this feature works only with the add to cart button for now.
This is useful if you want to show the custom option only when the customer selects a personalized variant.
The apperance of the field will vary based on your theme settings.
Open the theme customizer, then navigate to the product page template, select the Product information section, create a new Liquid block and paste the code inside.