2
votes

When I use products = ShopifyAPI::Product.all, I get only 50 prodcts because as I read the default :limit parameter = 50, but the maximum :limit value is 250, so how to retrieve all the products in a shop. Thanks.

1
Well you do a loop, with a start index and a limit I guess, this is without knowing the ShopifyApi, ShopifyAPI::Product.where(product_id > 50).limit(50); can you try page: 2 ?alexsmn

1 Answers

3
votes

I figured something out that seems to solve the problem.

count = ShopifyAPI::Product.count
page = 1 
while count > 0 do 
  products = ShopifyAPI::Product.find(:all,:params => {:page=> page})
  # perform work on products

  count = count - 50
  page = page + 1
end