[Dawn Theme] How To Add Custom Input Field (Specific Products and Collections)

If you are a Shopify store owner, then you know that there is a lot of flexibility when it comes to customizing your store. Sometimes, though, you may need a little bit more help to make the changes that you want. In this blog post, we will show you how to add a custom input field to products and collections. This will allow you to type in specific information for each product or collection. In this Shopify tutorial, we will show you how to do just that! This process is fairly simple and can be completed in a few minutes. Let’s get started!

Add following Code in main-product.liquid file

<p class="line-item-property__field">
<label for="childsName">Child's Name:</label>
<input id="childsName" type="text" name="properties[Child's Name]" form="product-form-{{ section.id }}">
</p>

Custom Field for Specific Product

{% If product.title == "Your product name" %}
<p class="line-item-property__field">
<label for="childsName">Child's Name:</label>
<input id="childsName" type="text" name="properties[Child's Name]" form="product-form-{{ section.id }}">
</p>
{% endif %}

Custom Field for Specific Collection

{% for collection in product.collections %}
  {% if collection.title contains "New Collection" %}
    
	<p class="line-item-property__field">
<label for="childsName">Child's Name:</label>
<input id="childsName" type="text" name="properties[Child's Name]" form="product-form-{{ section.id }}">
</p>
  
  {% endif %}
{% endfor %}
5/5 - (18 votes)

About

8 thoughts on “[Dawn Theme] How To Add Custom Input Field (Specific Products and Collections)”

  1. Thank you! My code didn’t tag the “if” in the Custom Field for Specific Product but after a couple mins of troubleshooting and googling, I got it. I was also able to successfully move the customization box after trial and error with the code (I have no idea how to read code). Overall, very helpful and pretty easy to follow. This was a lifesaver, thanks again!

  2. Hi! I added the code to my products that require personalization and see the fields on the product pages but when I do a test order, the information in those fields don’t show up anywhere. Am I missing something in the code or overlooking where to find that once the order is placed?

  3. Hi, where will the child’s name be saved ? i need to send the childname to the print company

    I use parallax and the name doesnt show in the order form

Leave a Comment

Your email address will not be published. Required fields are marked *