Pass data on various pages of the custom fields+ using theme app extension

I am a developer and building a storefront application using theme app extension. I got stuck in some part. Let me explain the issue:

On product description page, i want to add custom user input field that should display to all the customers who will visit the website (that store owner installed our application). Then, user fill some data in that field (custom field) now I want to pass that data on the cart page and also to other pages but didn’t know how to pass that data while using theme app extension.

This is so complicated. You said that don’t inject code in theme…ok…fine…if so then there should be some way…you said it can be done with theme app extension
..but HOW??

Hello Garg,

Are you going to add the theme extension code on the cart or any other page other than the product description page too? If yes, you can fetch the data using you own created API on the other pages that the customers have input on the product page, or you can save the data in localStorage as well.

Let me know if you have any other questions :slightly_smiling_face:

Thank you

Leith

Hello Leith,

Thanks. I am not adding theme app extension code on any other page. Only adding it on product detail page.

The custom field which I added on product detail page is a product attribute and on cart page I don’t need to add anything from the theme app extension as cart page automatic fetches all the product attributes in a loop.

So from this product details page, how can I pass data.

Please see the attached code which I am using. Please check it and suggest me. I am stuck in this for the last 5 days.