App reviews, troubleshooting, and recommendations
Hi there,
we would like to migrate to checkout validation. The docs are pretty straight forward with injecting a new Texfield that is validated. So far so good.
https://shopify.dev/docs/apps/checkout/validation/block-checkout-progress?framework=react
It is mentioned ...but you can use it as an example to build other customizations for field validation, such as the following: Address, Tax code, Phone number, PO box address, Name...
How could I validate and limit the number of characters for let's say the Email form field?
Is there any link for making this client-side validation?
Do you have Shopify plus. If you have, you can this.
Is it possible to test in a regular dev store? What are the docs?
Yes, It is possible. You can use this document.
https://shopify.dev/docs/apps/checkout/validation/create-simple-validation-rules
If have any questions let me know so I can clarify, and if not, and you'd like to work together please feel free to message me directly.
Hey,
thanks for your response.
I will explain it more in detail... Let's say I would like to limit the amount of characters to 25 for the first name within the checkout.
For this purpose I could presumably use the following target to define an error message
Since I cannot address the document object, which hook on the client side provides me with the current input so I can evaluate it?
Also I couldn't find any graphQL reference for the storefront API https://shopify.dev/docs/api/storefront
Thanks 🙏
No, you can't find it from Storefront API. There is an example at this link. You can access that data from the input variable.
Input: https://shopify.dev/docs/api/functions/reference/cart-checkout-validation/graphql/input
Example: https://shopify.dev/docs/apps/checkout/validation/create-simple-validation-rules
Please clarify how to target the checkout input form specifically while user types in his data
@MastersHub I found the answer how it should work theoretically.
https://belonginc.dev/members/marc/posts/shopify-checkout-extensions-validation
However, I am not able to grant the required level 2 access via the API-access tab . Also I am confused, since this is dev shop I am testing it ...
You can do this. There are two ways to do this. The example you gave is an example made with checkout UI. If you don't need Checkout UI, you don't need to do this. As far as I understand, there is not. You focus on the other method. Focus on the example below.
export function run(input)
There is enough data in the input here. You can see the details from the link here.
https://shopify.dev/docs/api/functions/reference/cart-checkout-validation/graphql/input
Cart -> BuyerIdentity -> Customer
I hope it does its job.
What if some goes through the checkout and is not (yet) a registered customer?
But I think you are wrong regarding the checkout UI.
Since I indeed would like to check what the user types into the field and whether it has >X characters it should prevent the buyer to continue while checking on that particular target.
It remains a secret to me how to gain that access within my dev store as all scopes are the .
You can do server side validation and limit the number of characters for the Email field with this new app:
https://apps.shopify.com/address-ninja
2m ago Learn the essential skills to navigate the Shopify admin with confidence. T...
By Shopify Feb 12, 2025Learn how to expand your operations internationally with Shopify Academy’s learning path...
By Shopify Feb 4, 2025Hey Community, happy February! Looking back to January, we kicked off the year with 8....
By JasonH Feb 3, 2025