FROM CACHE - en_header

Retrieving specific Products by Product ID by using the Shopify API gem

TeejO
Shopify Partner
8 0 1

I have been looking at the Shopify API gem. I have been trying to retrieve only a specific products and haven't cracked it.

ShopifyAPI::Product.find(:all, params: { id: @Product_ids } )
ShopifyAPI::Product.find(:all, params: { ids: @Product_ids } )

Has anyone found a way to do this?

Replies 2 (2)
_JB
Shopify Staff
Shopify Staff
836 99 214

Hey @TeejO 

You should just have to pass in the id. This is working for me:

ShopifyAPI::Product.find(4359735181334)

 

JB | Solutions Engineer @ Shopify 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

TeejO
Shopify Partner
8 0 1

The thing is I wanted multiple products and not a single product. I am thinking that we ca do it by creating a multiple product query in GraphQL.