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?
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!