Can you advise me how to limit the number of characters on the Cart Note in the Debut theme?

Solved

Can you advise me how to limit the number of characters on the Cart Note in the Debut theme?

lisamkg
Visitor
2 0 1

I am trying to limit the max character count to 320 on my "cart note" in the Debut theme. I believe this is done in the cart-template.liquid but am unsure what code adjustments to make. Any suggestions would be greatly appreciated. 

 

 

{%- if section.settings.cart_notes_enable -%}
<div class="grid__item medium-up--one-half cart-note">
<label for="CartSpecialInstructions" class="cart-note__label small--text-center">{{ 'cart.general.note' | t }}</label>
<textarea name="note" id="CartSpecialInstructions" class="cart-note__input" data-cart-notes>{{ cart.note }}</textarea>
</div>
{%- endif -%}
<div class="grid__item text-right small--text-center{% if section.settings.cart_notes_enable %} medium-up--one-half{% endif %}">

{%- assign cartDiscounts = 'template ' | split: ' ' -%}
{%- if cart.cart_level_discount_applications.size > 0 -%}
{%- assign cartDiscounts = cart.cart_level_discount_applications -%}
{%- endif -%}
<div{% if cart.cart_level_discount_applications.size == 0 %} class="hide"{% endif %} data-cart-discount-wrapper>
<div class="order-discount-card-wrapper" data-cart-discount>
{%- for discount_application in cartDiscounts -%}
<span class="order-discount order-discount--title order-discount--cart">
{% include 'icon-saletag' %}<span class="visually-hidden">{{ 'customer.order.discount' | t }}:</span><span data-cart-discount-title>{{- discount_application.title -}}</span>
</span>
<span class="order-discount order-discount--cart order-discount--cart-total">
-<span data-cart-discount-amount>{{ discount_application.total_allocated_amount | money }}</span>
</span>
{%- endfor -%}
</div>
</div>

Accepted Solution (1)

JasmeetVT14313
Shopify Partner
292 63 77

This is an accepted solution.

Hello @lisamkg 

Try updating below line of code from your above code

<textarea name="note" id="CartSpecialInstructions" class="cart-note__input" data-cart-notes>{{ cart.note }}</textarea>

with

<textarea name="note" id="CartSpecialInstructions" class="cart-note__input" maxlength="320" data-cart-notes>{{ cart.note }}</textarea>

 
Please hit LIke and mark as a solution if this helps

- VTN Customer Dashboard enhances your customer's dashboard with advanced features, profile management, and order tracking. Free trial available.
- Feel free to contact me at jasmeet.kaur@vtnetzwelt.com

View solution in original post

Replies 3 (3)

JasmeetVT14313
Shopify Partner
292 63 77

This is an accepted solution.

Hello @lisamkg 

Try updating below line of code from your above code

<textarea name="note" id="CartSpecialInstructions" class="cart-note__input" data-cart-notes>{{ cart.note }}</textarea>

with

<textarea name="note" id="CartSpecialInstructions" class="cart-note__input" maxlength="320" data-cart-notes>{{ cart.note }}</textarea>

 
Please hit LIke and mark as a solution if this helps

- VTN Customer Dashboard enhances your customer's dashboard with advanced features, profile management, and order tracking. Free trial available.
- Feel free to contact me at jasmeet.kaur@vtnetzwelt.com
lisamkg
Visitor
2 0 1

Thank you so much @JasmeetVT14313!

This did the trick! I aqppreciate your help very much. 🙌

David_J_Tyler
Shopify Partner
4 0 1

Worked for me also on the dawn theme editing 'main-cart-footer.liquid'.

Thank you!