All things Shopify and commerce
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>
Solved! Go to the solution
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
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
Thank you so much @JasmeetVT14313!
This did the trick! I aqppreciate your help very much. 🙌
Worked for me also on the dawn theme editing 'main-cart-footer.liquid'.
Thank you!
Hey Community 👋 Did you know that March 15th is National Everything You Think Is W...
By JasonH Apr 1, 2025Discover how to increase the efficiency of commerce operations with Shopify Academy's l...
By Jacqui Mar 26, 2025Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025