@Nikki_Urban_Ink
If you’re offering an engraving or similar service, you could also leave the radio buttons out and write something like:
Is this Product a gift?
Add the recipient’s name to it!
[Text Input Field]
By keeping it visible by default, your customers will directly see the benefit and wouldn’t have to take an additional step to see the form. From the user experience perspective, this would highlight and communicate your service in a faster way.
In this case, you also wouldn’t need any JavaScript added to the code and the implementation would be much easier and faster.
The following steps are specifically for the impuls theme
Step 1:
Create a form using the UI Form generator.
Step 2:
Create in the Code Editor a new snippet with a distinctive name (e.g. engraving-form.liquid) and paste the code from the UI Form generator.
Step 3:
In the Code Editor look for the product-form.liquid under snippets. Right above the -container place following snippet:
{%-render 'engraving-form' -%}
and save. You could also place this snipped at a different position, but keep in mind, that it has to be within the product’s form-tags.
Step 4:
Open the cart-item.liquid under snippets and place following code right beneath the
container:
{% unless line_item.properties == empty %}
{% for property in line_item.properties %}
- {{ property.first }}: {{ property.last }}
{% endfor %}
{% endunless %}
and save.
Step 5 :
Change styling if necessary
As a result, you should see the text input form on the product page and, if used, the text input displayed in the cart.
You could also add the customer’s input in the confirmation mail by adding the line-items.properties. Check this Shopify Developer Page to find out more about the line-items.properties and how you can use them.
I hope this short explanation helps.