For discussing the development and integration of subscription-enabled shops using Shopify's Subscription APIs.
I have a product with a single variant. That variant has been assigned a subscription plan in a group.
When I experiment with the product subscription extension, and test out the Add which means "Add this product to some subscription plan", I am handed data by Shopify. The data I am handed only represents the product ID, and the variant is null. WHY? How is that helpful? If I am only supposed to show the subscription plans not currently assigned, I have to compare the variant ID to the plans to hide the ones it already has. But if Shopify does not provide this variant ID, that is not logically possible. Here is the data I am handed.
Why is variant ID undefined? And since it is undefined, how is someone supposed to filter with solely the product ID?
Hi @HunkyBill, can you confirm the variantId is undefined when adding the variant (not the product) to a selling plan group?
I see the app extension is rendered in both the product and variant page.
To learn more visit the Shopify Help Center or the Community Blog.
In Shopify, when editing product details, there is no separate variant page when there exists only one variant. So in my case, I am viewing the product details page, and seeing the subscription set on the one variant, which is true. I assigned the variant to the selling plan.
I would like to know why setting subscriptions with a valid API key on a valid product, is failing trigger anything in Shopify checkout in my development store. This is super frustrating. Nothing seems correct with Subscription API work, at this time.
I can reach the variant page of a product with a single variant by clicking/tapping in the variant.
To learn more visit the Shopify Help Center or the Community Blog.
I would like to know why setting subscriptions with a valid API key on a valid product, is failing trigger anything in Shopify checkout in my development store. This is super frustrating. Nothing seems correct with Subscription API work, at this time.
On your frustration, it might worth moving it to a new post to increase the visibility with the community.
In any case, can you guide us all with specific information to be more helpful? What do you mean with "trigger anything"? Feel free to DM me to share non-public information on this regards.
To learn more visit the Shopify Help Center or the Community Blog.
You are demonstrating a product with options, hence more than one variant. My product has just a single variant, and therefore is presented as per the image here. So there is only the product and its single variant, and why therefore Shopify is not sending the ID for the variant is seemingly weird.
Oh! Got it, got it. Thank you for clarifying this.
If I am only supposed to show the subscription plans not currently assigned, I have to compare the variant ID to the plans to hide the ones it already has.
So, to solve for your case I suggest you to compare with both variant and product ID. In a single-variant product, Selling
1: https://shopify.dev/api/admin-graphql/2022-04/objects/SellingPlanGroup#queries
To learn more visit the Shopify Help Center or the Community Blog.