product.selling_plan_groups not populating

Solved
BStubbs
Shopify Partner
127 14 51

I've successfully created a SellingPlanGroup and added a Product and a ProductVariant to it. I have confirmed this with a productCount returning 1.

However, when I try to expose product.selling_plan_group via Liquid its blank. Here is a badly formatted version of the GraphQL request to create the SellingPlanGroup.

 

{
          sellingPlanGroupCreate(
              input: {
                  name: "Monthly"
                  merchantCode: "monthly_plan"
                  options: ["Frequency"]
                  position: 1
                  sellingPlansToCreate:
                  [
                     {
                         description: "Monthly Subscription"
                         options: "Monthly"
                         name: "Monthly"
                         billingPolicy: { recurring: { interval: MONTH, intervalCount: 1 } }
                         deliveryPolicy: { recurring: { interval: MONTH, intervalCount: 1 } }
                     }
                  ]
                  }
                  
             ) {
             sellingPlanGroup {
             id
             }
             userErrors {
             field
             message
             }
             }
          }

 

Anyone have any ideas?

Was this helpful? Press like!
Did it fix the problem? Mark it as the solution for others!
Buy me a beer? Well, sure!
BStubbs
Shopify Partner
127 14 51

This is an accepted solution.

For future reference:

My dev store did not have Shopify Payments active.

That was it.

Was this helpful? Press like!
Did it fix the problem? Mark it as the solution for others!
Buy me a beer? Well, sure!
sharie
Shopify Partner
7 1 9

I'm also working on  sellingPlanGroupCreate (and running into my own problems with being unauthorized to access that mutation).

For your problem, did you associate the product ID with the plan?

0 Likes
BStubbs
Shopify Partner
127 14 51

Hi @sharie 

You need to get permission to access the early beta of the API. It will be freely available in the 2021-01 release. 

Yes I did, it was very straightforward to create and add products to the group. 

My problem was solved when I activated Shopify Payments on my dev store. 

Good luck with your project!

Was this helpful? Press like!
Did it fix the problem? Mark it as the solution for others!
Buy me a beer? Well, sure!
kunalwf
Tourist
4 0 1

Wish I could buy u a beer @BStubbs 

Derek_Morin
Shopify Expert
149 0 27

Could I grab/get the selling_plan variant property in cart.json or anywhere else? Let's say I want to know if what's in the cart is a one-time item or a subscription-based item. 

0 Likes
kunalwf
Tourist
4 0 1

Yes, this seems to be included on line items via cart.js, and works  https://shopify.dev/docs/themes/liquid/reference/objects/selling-plan-allocation

0 Likes