Why isn't custom field input showing in my cart or test order?

Topic summary

A user encountered an issue where custom text field input (for dog name engraving) displayed correctly on the product page but failed to carry over to the cart or test orders.

Root Cause Identified:

  • The custom field code was placed in the wrong <form> tag within the main-product.liquid file
  • The product template contains two <form> tags; code must be in the second one

Solution Steps:

  1. Move the custom field code snippet to the second <form> tag in main-product.liquid
  2. Add corresponding display code to main-cart-items.liquid to show the custom field value in cart
  3. Include similar code in checkout/order templates if needed

Status: Issue resolved. The user confirmed the solution worked after relocating the code.

Alternative Approaches Mentioned:

  • Using Shopify apps for Product & Variant Options to avoid manual coding
  • Free UI Elements generators for adding custom fields across product pages, cart, and contact forms

Multiple respondents provided code snippets and screenshots demonstrating proper placement and expected results.

Summarized with AI on November 14. AI used: claude-sonnet-4-5-20250929.

Hi everyone. Im having trouble with adding custom fields in my order forms. I’d like the customer to be able to include their dog’s name when ordering so that it can be engraved. I found a number of videos and articles on the subject. I was able to get the short text field to show up just fine, but the text entered doesnt carry over into the cart or show up in the test order.

website: www.dougwork.com

Theme: Refresh

Code added to main-product.liquid

{% if product.template_suffix == 'dog-breeds' %}
     

        
        
     

{% endif %}

Hi @DougWork

In your case, you can follow these steps:

  1. Search “main-cart”

  1. Find the code in the “main-cart-items.liquid” file

Then, add this code after the line of code you found. Check our following image for more information.

```markup

 
 

  1. Do the same in the “cart-drawer.liquid” file

The reference result:

If editing the code is a little bit complex, you can consider using some apps (e.g., Product & Variants Options) on the Shopify app store to save time.

Feel free to let me know if you need any further help.

@DougWork ,

Your code is correct, it’s just you have placed it in wrong tag in main-product.liquid we have two tag.

Please cut your code snippet and paste it in second tag and it will work

Value in cart:

1 Like

Hello @DougWork ,

You can refer to this community answer it will surely help you fix this.

https://community.shopify.com/c/shopify-design/how-to-add-line-item-properties-in-products-in-one-particular/td-p/1609162

Regards,

CedCommerce

nailed it! I knew it had to be something simple that i was missing. Thanks so much for the help!

We’re glad it helped you @DougWork , keep growing we got your back.

A humble request could you please accept this answer as solution if you find this helpful. Thank you!!

Hi @DougWork

Welcome to the Shopify Community!

  1. Find the below code in the ““main-cart-items.liquid”” file.

Regards,

Mehak

Hi,

For future referenced. You can add a custom field using our enhanced Shopify UI Elements generator. You can see the informations at the back end. It works on product page, cart page, and on contact form. The good this is, it is FREE and no app needed.

Please check our video tutorial below