A space to discuss online store customization, theme development, and Liquid templating.
Hello Everyone,
I tried the solution given by another Developer in adding custom fields inside the cart page by generating them from here - https://ui-elements-generator.myshopify.com/pages/cart-attribute, and placing them inside the form tags of my Cart template. It works with Debut theme, however, when I tried testing it in Dawn, the form shows but the data never appeared inside my Orders (Admin Panel).
Is there an alternative solution for 2.0 themes, specifically Dawn?
sample form
After checkout, when I checked orders
Solved! Go to the solution
This is an accepted solution.
Someone gave a solution in Stackoverflow, by adding attribute form="cart" to each of the input fields. By the doing so, the syntax will be like this:
<p class="cart-attribute__field"> <label for="long-custom-text">Long Custom Text</label> <textarea required form="cart" class="required" id="long-custom-text" name="attributes[Long Custom Text]" > {{ cart.attributes["Long Custom Text"] }} </textarea> </p>
Works like magic!
yes it work on Dawn theme also but you need to make sure you add this code in site
<form> </from> tag
This is an accepted solution.
Someone gave a solution in Stackoverflow, by adding attribute form="cart" to each of the input fields. By the doing so, the syntax will be like this:
<p class="cart-attribute__field"> <label for="long-custom-text">Long Custom Text</label> <textarea required form="cart" class="required" id="long-custom-text" name="attributes[Long Custom Text]" > {{ cart.attributes["Long Custom Text"] }} </textarea> </p>
Works like magic!