Only first property is shown cart of Dawn theme

Solved

Only first property is shown cart of Dawn theme

jefrey
Visitor
2 0 1

I added the following liquid code to my product page:

<p class="line-item-property__field">
<label for="name">Name</label><br>
<textarea required class="required" id="name" name="properties[Name]" form="product-form-{{ section.id }}"></textarea>
</p>
<p class="line-item-property__field">
<label for="ort">Ort</label><br>
<textarea required class="required" id="ort" name="properties[Ort] form="product-form-{{ section.id }}"></textarea>
</p>
<p class="line-item-property__field">
<label for="land">Land</label><br>
<textarea required class="required" id="land" name="properties[Land] form="product-form-{{ section.id }}"></textarea>
</p>
<p class="line-item-property__field">



 When I put the product to the cart and go to the Cart page, I only see the first line property (name) being displayed. When I look at the code of main-cart-items.liquid it seems that it goes through a list of properties. But it seems that the list of properties that goes from the product page to the cart has essentially only the length of 1.

 

What do I have to do so that all line item properties are displayed in the cart?

Accepted Solution (1)

tim
Shopify Partner
4710 575 1702

This is an accepted solution.

If this is the exact code you have on your page then this happens because you're missing a closing quotation mark on second and third textareas.

This is how browser sees their names:

<textarea required class="required" id="name" name="properties[Name]" form="product-form-{{ section.id }}"></textarea>
<textarea required class="required" id="ort" name="properties[Ort] form="product-form-{{ section.id }}"></textarea>
<textarea required class="required" id="land" name="properties[Land] form="product-form-{{ section.id }}"></textarea>

They are not even part of the same product form because of this.

If my post is helpful, hit the thumb up button -- it will help others with similar problem to find a solution.
I can be reached via e-mail tairli@yahoo.com

View solution in original post

Replies 3 (3)

tim
Shopify Partner
4710 575 1702

This is an accepted solution.

If this is the exact code you have on your page then this happens because you're missing a closing quotation mark on second and third textareas.

This is how browser sees their names:

<textarea required class="required" id="name" name="properties[Name]" form="product-form-{{ section.id }}"></textarea>
<textarea required class="required" id="ort" name="properties[Ort] form="product-form-{{ section.id }}"></textarea>
<textarea required class="required" id="land" name="properties[Land] form="product-form-{{ section.id }}"></textarea>

They are not even part of the same product form because of this.

If my post is helpful, hit the thumb up button -- it will help others with similar problem to find a solution.
I can be reached via e-mail tairli@yahoo.com
jefrey
Visitor
2 0 1

You were 100% right.... I should have used a real code editor!

 

Thank you VERY much for helping me and fixing the bug. Everything is working now!!! Great! 

tim
Shopify Partner
4710 575 1702

Extra pair of eyes is always helpful in cases like this.

If my post is helpful, hit the thumb up button -- it will help others with similar problem to find a solution.
I can be reached via e-mail tairli@yahoo.com