Custom text box in cart not showing up in orders

Hi,

I need two text boxes in my cart, one for order notes and one for attaching a message to the order. The custom text box for messages shows up in the cart, but anything I type in it does not show up on the order page.

This is what the theme came with (with a label tweak from me):

{%- if settings.show_cart_note -%} Order notes: {{ cart.note }} {%- endif -%}

This is what I pulled from the Shopify generator:

Add a handwritten message: {{ cart.attributes["Add a handwritten message"] }}

I tried putting it in many different spots in the code – it usually shows up in the cart but whatever I type in it doesn’t end up showing on the order page.

This is where I have it now:

Add a handwritten message: {{ cart.attributes["Add a handwritten message"] }}

{%- if settings.show_cart_note -%} Order notes: {{ cart.note }} {%- endif -%}

And this is what it looks like in the cart (bonus question: how can I make the message box look like the order note box instead of the plain white box?):

Any help at all would be much appreciated!!!

Thanks!

1 Like

@blooming98

can you please recreate https://ui-elements-generator.myshopify.com/pages/cart-attribute

Hi @blooming98

Maybe Shopify can’t catch the attributes of the code you added. You can try it this way:


  
  

If it doesn’t work, I suggest that you can consider using the Shopify Product Label app that supports this feature.

Hi @blooming98 ,

Please change all code:


        
        
      

      
        {%- if settings.show_cart_note -%}
        
        {%- endif -%}
      

Hope it helps!