View custom field in cart in a template using json files

Hello!

I’ve recently downloaded the theme Craft and started customizing it. I added a custom text field to my product pages in my current theme by adding some liquid code to the ‘product.customizable.liquid’ as explained in this post: https://community.shopify.com/c/shopify-design/product-pages-get-customization-information-for-products/m-p/616525#sectioned-themes. I also added some liquid code to the cart template so I could see what my customers had written in the text field in my order page. I wanted to do the same to the Craft theme but this theme uses json files instead of liquid. I added a liquid section in the theme editor so I already managed to get the custome text field on my product page but now I have no idea how I can add this information to the cart and order section so I can see the input in my order overview. Can someone help me out?

Thanks in advance!

Hi @Verbloemdepost ,

If you are using properties to add information on the product page, the Craft theme will default to display it on the cart page.

Please go to sections > main-cart-items.liquid file, code shown here:

Hope it helps!

1 Like

I’m using the Dawn theme. I used the theme editor to create unique product templates that have special entries by adding custom liquid sections and pasting in code from this site https://ui-elements-generator.myshopify.com/pages/line-item-property

The pages look right and I can input the information, but they are not being required per the code suggested on that site and they are not reflected/showing in the cart or anywhere I can see in the back end. How do I see order inputs?

I went into to edit the code and found the bit you mention in your response, so supposedly it defaults that this should be displayed in the cart, but it isn’t working for some reason. I’m not sure where I went wrong / how to fix this so I can actually see the field inputs. Thanks so much for your help!

Hi! Did you get this resolved? I am having the same issue and can’t figure out why the custom input fields are not showing in the cart.