How can I add a 10-digit validation field to my cart page?

How can I add a 10-digit validation field to my cart page?

adrian56
Tourist
4 0 1

Hi everyone!
I need to add a field like this on my store page, with additional validation up to 10 digits, could someone help me to create such a field?
Thanks in advance for any hint
Zrzut ekranu 2023-11-13 o 20.40.19.png

Replies 3 (3)

BSS-Commerce
Shopify Partner
3477 463 540

Hey @adrian56 ,

Currently, default themes do not support adding theme fields with validation, you can use another app that supports this feature or hire a custom expert for your store.

If our suggestions are useful, please let us know by giving it a like, marking it as a solution, or donating here .


B2B Solution & Custom Pricing | Product Labels by BSS


Need help from our expert? Kindly share your request with us via community@bsscommerce.com


BSS Commerce - Full-service eCommerce Agency

gr_trading
Shopify Partner
1935 146 202

Hi 

 

You can add additional order information on checkout page through cart attribute.

For this add below code in shopify cart.liquid file between the <form> and </form> tag. The form field will appear wherever you place the code.

 

<p class="cart-attribute__field">
<label for="your-name">Your name</label>
<input id="your-name" type="text" name="attributes[Your name]" value="{{ cart.attributes["Your name"] }}">
</p>

 


 Let me know if you have any questions?

For any custom development WhatsApp or connect at Email ID: gr.trading15@gmail.com for quick consultation. | Shopify Free codes
To support Buy Me a Coffee

EasifyApps
Shopify Partner
635 19 47

Hi @adrian56,

I wanted to share a suggestion that could streamline the process of number validation for your custom options. Consider displaying these options directly on the product pages instead of the cart page. This adjustment not only enhances the user experience but also makes implementing number validation more straightforward.

If you're open to making this change, the free Easify Product Options app is a tool that can assist you seamlessly. Here's a quick demo to illustrate 🤗:

  • Storefront:

EasifyApps_2-1703671829677.png

dvb.png

 

EasifyApps_3-1703671918355.png

 

  • App Settings:

EasifyApps_0-1703671668395.png

dchk.png

EasifyApps_1-1703671689362.png

EASIFY - MAKING SHOPIFY SIMPLE & SWEET!
Easify Product Options: Create custom product options 10X faster & easier!
Easify Product Attachments: Effortlessly add downloadable PDF files (or any other format) to Shopify pages!
Try for Free | 24/7 Live Chat Support