How to obtain data outside of post-purchase checkout

Solved

How to obtain data outside of post-purchase checkout

allansilva
Shopify Partner
6 3 0

I'm developing two integrations to a Shopify ecommerce.

First integration

The ecommerce customer will fill a form modal with some informations. After that, the browser will save some responde informations into localStorage.

 

Second Integration

This is the post-purchase checkout. I need to access a information from that response, wich I can only get on modal request. I've tried to use localStorage inside post-purchase react code, but didn't work. There is a way to pass or receive an info directly for post-purchase?

Accepted Solution (1)

allansilva
Shopify Partner
6 3 0

This is an accepted solution.

According to Discord answers:

 

"Hey Allan, the post you linked is about an extension not rendering, I understand you are asking about local storage instead? The extensions are running in a sandbox, so you don’t have access to all the browser APIs you would normally have access to. There is a storage API we provide though, please see https://shopify.dev/api/checkout-extensions/extension-points/api#storage and the code in https://shopify.dev/apps/checkout/post-purchase/getting-started-post-purchase-extension#step-3-build...."

 

"If this data is available before checkout, you could send it from the storefront to your server and save it in a DB. Then in the ShouldRender post-purchase extension point, you can fetch if from your server"

 

https://discord.com/channels/842813079926603828/1040012094621364235/1040338981700771981

https://discord.com/channels/842813079926603828/1040012094621364235/1040757147455205516

View solution in original post

Reply 1 (1)

allansilva
Shopify Partner
6 3 0

This is an accepted solution.

According to Discord answers:

 

"Hey Allan, the post you linked is about an extension not rendering, I understand you are asking about local storage instead? The extensions are running in a sandbox, so you don’t have access to all the browser APIs you would normally have access to. There is a storage API we provide though, please see https://shopify.dev/api/checkout-extensions/extension-points/api#storage and the code in https://shopify.dev/apps/checkout/post-purchase/getting-started-post-purchase-extension#step-3-build...."

 

"If this data is available before checkout, you could send it from the storefront to your server and save it in a DB. Then in the ShouldRender post-purchase extension point, you can fetch if from your server"

 

https://discord.com/channels/842813079926603828/1040012094621364235/1040338981700771981

https://discord.com/channels/842813079926603828/1040012094621364235/1040757147455205516