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:
- Search “main-cart”
- 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
- 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
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!
- 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