We are migrating from checkout.liquid to Checkout extensibility. We need to migrate this custom javascript function in checkout.liquid script tag to implement them as extensions within an app. I looked into the Shopify functions here - https://shopify.dev/docs/apps/functions and the many use case tutorials. However My use case doesn’t fit any of these use cases in here. My use case is to apply this business logic where if the custom carrier service doesn’t allow shipping to the mentioned shipping address, I need to redirect from checkout to the cart page. How would I do a redirect within functions ? Please provide some guidance.
Hi @kevingeorgex – You should also look at the capabilities of Checkout UI Extensions, but you might also want to reconsider your UX. A validation function may be a better option to prompt the user to provide a different shipping address.
Thankyou !
Out of curiosity, were you ever able to get this redirect functionality to work, Kevin? If so, was it via Checkout UI Extensions after all? We were hoping to use Shopify Functions for this but the redirect functionality appears to not exist.