For discussing the development and usage of Checkout UI extensions, post-purchase extensions, web pixels, Customer Accounts UI extensions, and POS UI extensions
Hi Everyone,
Hoping someone can help me out. We are trying to move away from checkout.liquid and scripts.
Currently we have a script that prevents checkout when the address is invalid (po-box) by hiding the shipping options as well as only displaying the free shipping option if there is one.
I have created a function that does this and it mostly works the only issue I have is that once all shipping options are hidden then the function stops firing. Has anyone seen this before?
Or does anyone know another way to prevent checkout based on the address that will work with extensibility?
See code below
Solved! Go to the solution
This is an accepted solution.
Hi Matthew,
Have you looked into using the Checkout Validation API to prevent a checkout when the address is invalid?
Liam | Developer Advocate @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog
This is an accepted solution.
Hi Matthew,
Have you looked into using the Checkout Validation API to prevent a checkout when the address is invalid?
Liam | Developer Advocate @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog
Thanks Liam, that was way easier
Great to hear this works for your use case!
Liam | Developer Advocate @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog