We need to display the list of all the variants on the product page, in the App Block. Earlier we were using Liquid for this purpose and it was working perfectly. Now after 2k variants were introduced we had to look for another option as we only gave access to first 250 variants max via Liquid, so we switched to Storefront API. It’s working properly for the most cases except on Shopify Plus stores that have some custom prices set with B2B Catalogs. In that case Liquid is returning proper prices for current logged in customer, but with Storefront API we’re getting default price.
So my question is how to display all the 2k variants on the product page as a list and to make it work properly prices set for individual customers with B2B Catalogs for Shopify Plus stores?
Hey @Denis_NexusMedia - thanks for the question. We’re adding support for the paginate tag for product.variants. So essentially:
{% paginate product.variant by 50 %}
In order to render the remaining variants, you can use the section rendering API. We hope to release the pagination feature and an updated quick order list in the latest dawn in the next couple of weeks - this will provide an example.
Let me know if you for see any concerns with this approach.
Hi @Tim-Shopify, thanks for your reply. Pagination on variants could be useful, but the problem is that we can’t use Section Rendering API for the app blocks. I.e. we can’t add our app section and get all the variants in it.
Just to be clear from my comment, take this PDP for example, it lists the variants. But if the merchant was to utilise 2048, how does Shopify plan to present this?
My best bet would either be a brand new designed view with interactive filtering/sorting using SRA/pagination. Theres not really a good UX perspective for it either way.
@Denis_NexusMedia App blocks should be able to use the parent section to re-render (docs). Please let me know if you’re having issues with this approach.
@Luke@curzey Thats the Quick Order List that I had mentioned above. We will release for Dawn and the other 1P themes, including Trade. We have included an explicit “next page” and page numbers action at the bottom of the list for users to paginate. This list will be as long as the pagination is set to in the theme.
@curzey Agreed - future improvements could be filter/sorting or some client side trigger to append additional variants to the list without requiring clicking “next page”.
Thanks @Tim-Shopify! We’ve just tried paginate for product.variants and we’re always getting 250 variants no matter what limit we have in paginate. I.e.
{% paginate product.variant by 50 %}
still renders 250 variants and ignores the actual page parameter.
Or that functionality is not officially released yet and we should wait for the release in Dawn theme?
@Denis_NexusMedia ah yes - sorry that was unclear. We still need to ship support for the paginate tag. It should be rolled out in the next week or two. I’ll update this thread once we do.