For discussing the development and usage of Checkout UI extensions, post-purchase extensions, web pixels, Customer Accounts UI extensions, and POS UI extensions
Hi,
I have created discount app function using documentation, Now I want to extend and want to add Product picker, So I can select products for which that discount would be applied.
I have used Resource Picker but after products are selected, How we can get Product ids and where can save that product ids? Can anyone help please?
Hi Agandhicb,
Once you have the product picker set up and products are selected, you'll need to handle the selection event to get the product IDs. Here's a general overview of the steps you'll need to take:
Handle the Selection Event: When products are selected using the Resource Picker, an event is triggered. You need to handle this event to get the selected product data.
Extract Product IDs: The event data will include information about the selected products. You'll need to parse this data to extract the product IDs.
Store the Product IDs: After extracting the product IDs, you'll need to decide where to store them. Common options include a database associated with your app, or Shopify's metafields if you want to store the information directly in the Shopify store.
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