Note in Cart - Mandatory

Highlighted
New Member
2 0 0

Hi, 

I just created a note for the cart using the <brooklyn> template in shopify.

However, I would like this note to be  Required (mandatory). In other words, you would not be able to click on checkout without writing something in the note field. 

Does anyone know how to do this? 

Any help would be much appreciated. 

Gigi

0 Likes
Highlighted
Shopify Staff
Shopify Staff
127 0 9

Hey there,

For that, you need to add in the required code.

I would suggest checking out the Markup Generator Tool for adding in a text form field cart attribute with the required field checked.

Here is an example of how the code would look:

<p class="cart-attribute__field">
  <label for="enter-details-here">Enter details here</label>
  <textarea required class="required" id="enter-details-here" name="attributes[Enter details here]">{{ cart.attributes["Enter details here"] }}</textarea>
</p>

Ensuring you have the proper required class set, that will prevent people that leave this field blank from proceeding to checkout.

Hope that helps!

Justin L

0 Likes
Highlighted
New Member
4 0 0

Does this still work in 2019? We tried adding required fields from the generator tool, to the cart, but were able to proceed without filling them out. If they're required, the user should not be permitted to proceed unless the fields are filled.

0 Likes
Highlighted
New Member
1 0 0

I have tried this and it hasn't worked as it still allows me to process through the check out without filling anything in.

Any ideas?

0 Likes