Is there a way to Get Collections of each product in the shopping cart?

Hi there!

I am a new to shopify development and working on my very first shopify app.

My app displays some data on the cart page based on the products in the users shopping cart. I am using the Shopify AJAX API to get cart contents but it doesn’t contain the collection data for products. My code depends on that information to accurately create the data to be displayed.

I know that it can be done by using the admin api but that will be too costly in terms of API limits as i will have to get the collections separately for each product in the shopping cart. Is there a better way of doing this efficiently?

I’m wondering the the ResourcePicker could be used to fetch any product variant related info such as this? https://shopify.dev/tools/app-bridge/actions/resourcepicker

1 Like