Solved

How to redirect from Thank you page extensions to another url?

raj_asha
Shopify Partner
10 0 0

Hi,
We have a Thank you page extension that displays a product that can be added from the thank you page. So, if a user clicks "Buy" button, we call the mutations for updating the order:

We get the additionalPaymentCollectionUrl from the response which we return to the frontend to redirect the user to complete payment.
Unfortunately, I am not able to use window.location since we do not have access to it in extensions(remote-ui).

 

Can you please suggest a way to redirect to a URL from the Thank you page extensions? 
Thanks!

Accepted Solution (1)

Liam
Shopify Staff
2731 302 777

This is an accepted solution.

Hi Raj_asha,

 

I've connected with the product team on this, and it appears that it's not currently possible to perform a browser redirect from the Thank You page. However, what you're looking to accomplish (adding a new product following a completed order) sounds similar to a post-purchase (see our docs here). Is that an option you could use?

Hope this helps,

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

View solution in original post

Replies 4 (4)

Liam
Shopify Staff
2731 302 777

Hi Raj_asha,

 

I've connected with our internal dev team on this to determine how the best way to migrate your apps functionality to checkout extensions. I'll update here asap!

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

Liam
Shopify Staff
2731 302 777

This is an accepted solution.

Hi Raj_asha,

 

I've connected with the product team on this, and it appears that it's not currently possible to perform a browser redirect from the Thank You page. However, what you're looking to accomplish (adding a new product following a completed order) sounds similar to a post-purchase (see our docs here). Is that an option you could use?

Hope this helps,

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

raj_asha
Shopify Partner
10 0 0

Hi Liam,

Thanks for the quick response. We are already using post-purchase but want to additionally provide product offers to users when they land on the Thank you page.

Could this be supported in the near future? Maybe even providing an API similar to React useRef by which we can programmatically make a click would solve the issue for us.

Thanks!

Liam
Shopify Staff
2731 302 777

Hi again Raj_asha,

 

I have submitted this as a feature request - so it may be available in future releases. 

 

Hope this helps!

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