Re: I'm working on an Shopify app with a checkout extension and was hoping someone might have an ans

I'm working on an Shopify app with a checkout extension and was hoping someone might have an answer

Renato22
Shopify Partner
2 0 2

I am trying to display something in my extension, but only if a specific shipping rate is chosen. I'm already retrieving the shipping address the customer inputted in the checkout, but in my readings of the docs, I haven't seen anything that suggests also reading the Shipping Rate selection might be possible. Does anyone know if it is possible to detect when/which Shipping Rate a customer has selected in the checkout from within a checkout extension?

I've been trying a lot of things. Ran out of options

Replies 3 (3)

Yeady123
Explorer
61 7 9

The Shopify checkout process is a closed system and doesn't provide a direct way to access the selected shipping rate from within a checkout extension. However, you can still implement this functionality using a workaround.

One option is to send the selected shipping rate information to your server and then have your server store the information in a database. Your checkout extension can then retrieve the information from the database to display the relevant information.

Another option is to include the shipping rate information in a hidden form field on the checkout page, and then pass the information to your checkout extension through the form data. In this case, you would need to write JavaScript to update the value of the hidden field whenever the shipping rate changes.

Regardless of which approach you choose, you'll need to use a server-side language, such as Ruby on Rails or Node.js, to store and retrieve the shipping rate information.

I hope this helps! Let me know if you have any other questions.

- Was my reply helpful? Click "Like" to let me know!
- ----Was your question answered? Mark it as an Accepted Solution
You can get in touch with me via WhatsApp on +88013-13075440
Email: shahinkhan2424ft@gmail.com
Renato22
Shopify Partner
2 0 2

Hi! thank you. Do you know how to watch for changes in checkout? is there some listener function that can be implemented that will report back to the extension?

Ponmari
Shopify Partner
20 1 4

hi @Renato22 

 

Have you found the solution?

 

I think you can get it through