Hi guys, I have a question that If I want to delete a customer address and redirect to /account not /account/addresses, what should I do? I follow Shopify guide and dawn theme to delete via form submitting but it didn’t work as expected.
I attach 2 images, the first one is from dawn theme /assets/global.js and the last one is where I trigger it.
You need to modify the return_to parameter value in the Shopify.postLink function call.
The return_to parameter is set to '{{ routes.account_url }}', which is a Liquid variable that gets replaced with the actual account URL when the page is rendered.
Depending on your theme and store configuration, this might not result in the desired /account URL.
This is why the redirection might not be working as expected.
The return_to parameter is set to a hardcoded string '/account'. This ensures that the user is always redirected to the /account page after the address is deleted, regardless of the theme or store configuration.