Shopify / shopify-app-js

MIT License
274 stars 106 forks source link

Ajax API with new 2000-variant limit #1209

Open MathieuJDS opened 2 months ago

MathieuJDS commented 2 months ago

Description

Hello,

I don't know where to add this issue exactly so I'm doing it here.

I am using the AJAX API to get product information directly from a store (to get variants).

I used the dev preview store to get the new 2000-variant limit.

I created a product with 820 variants.

When using the ajax API: /product/.js

I get only the first 100 variants (and no pagination system)

I don't know if it's me and I didn't find something, or if it wasn't updated

Expected behavior

We should get all the variants of the product or at least a pagination system

Actual behavior

Only 100 variants are sent

Steps to reproduce the problem

  1. Use a dev store with the new variant limit
  2. Create a product with a minimum of 101 variants
  3. Call the ajax API to get product information with the endpoint /products/.js
sle-c commented 2 months ago

hi @MathieuJDS,

This question is more suitable in the Shopify Community forum. The Ajax api doesn't return more than 100 variants on purpose due to the payload size. Would you tell about your use case and why you need to get more than 100 variants using the AJAX api?

Thank you,

MathieuJDS commented 2 months ago

I had posted on the forum but have yet to receive a response. Now, I did receive one.

I am using this endpoint to get information about the variants, such as the actual prices of a product (for example, when there is Shopify Market, it allows me to get the prices of the currently selected currency) and many similar situations.

They returned 100 variants, which made sense when the limit was 100.

But now that it will increase, isn't it logical to improve it with a pagination system?

Thanks,

Mat

MathieuJDS commented 2 months ago

Hello, any news here?

Thank you!

MathieuJDS commented 1 month ago

Hello

I am still waiting for a solution there if you have anything

Thanks,

Mat