limit cart note characters

Solved
Jrichardsonxx
Tourist
5 0 1

Can you advise me how to limit number of characters to in note to seller? Customers are writing very long gift messages that we can't fit on our cards! I'm using Turbo theme.
Appreciate any help,
Jess

KetanKumar
Shopify Partner
17100 1856 6413

@Jrichardsonxx 

sorry for this issue can you please try this similar 

https://www.w3schools.com/tags/att_textarea_maxlength.asp

If helpful then please Like and Accept Solution.
Want to modify or custom changes on store Hire me.
- Feel free to contact me on bamaniyaketan.sky@gmail.com regarding any help
Shopify Expert | Skype : bamaniya.sky
PSD to Shopify | Shopify Design Changes | Shopify Custom Theme Development and Desing | Custom Modifications In to Shopify Theme | SEO & Digital Marketing
Jrichardsonxx
Tourist
5 0 1

Do you have any more information in applying this solution to Turbo theme?

Many thanks,

Jess

0 Likes
Ninthony
Shopify Partner
1794 259 707

We dont have access to Turbo theme as it's paid. You'll have to locate the text input that the cart note goes into in your cart template and add a max-length property as provided by @KetanKumar. If you can provide your store url and password if password protected (Online Store > Preferences > Password Protection), we may be able to guide you how to make the change.

If my solution helped you, please like and accept as solution!
If you'd like to make any edits to your store, please send me a personal message and we can discuss what you'd like to accomplish :D
0 Likes
Jrichardsonxx
Tourist
5 0 1

That makes sense.

https://tugboat.co.uk/

Many thanks, 

Jess

0 Likes
Ninthony
Shopify Partner
1794 259 707

This is an accepted solution.

So two approaches you can take here. Open your cart-template.liquid file in your assets folder. Ctrl + f and search for "note" -- look until you find something that looks like this:

<textarea id="note" name="note" rows="2" class=""></textarea>

 

Then add the maxlength attribute to it:

<textarea id="note" name="note" rows="2" class="" maxlength="50"></textarea>

 

If you can't figure that out, you can put this in theme.liquid right before the closing body tag (</body>):


<script>
$(function (){
$('#note').attr('maxlength','50');
})

</script>

 

Just change 50 to however many characters you want to allow in any instance.

If my solution helped you, please like and accept as solution!
If you'd like to make any edits to your store, please send me a personal message and we can discuss what you'd like to accomplish :D
Jrichardsonxx
Tourist
5 0 1

That worked a treat.

Much appreciate the help!

Jess

0 Likes