Hello there,
I’ve been trying to update a sellingPlanGroup using the mutation called sellingPlanGroupUpdate. But it sends an error as ‘Cannot have multiple selling plans with the same name.’ OR 'Cannot have multiple selling plans with the same options’.
Here is the currentsellingPlanGroup
{
"data":{
"sellingPlanGroup":{
"appId":"WS-Subscription",
"description":null,
"name":"Pawty Pick Monthly Subscription",
"options":[
"Delivery every"
],
"sellingPlans":{
"edges":[
{
"node":{
"id":"gid:\\/\\/shopify\\/SellingPlan\\/460619843",
"name":"Bi Monthly",
"options":[
"2 MONTH"
],
"position":1
}
},
{
"node":{
"id":"gid:\\/\\/shopify\\/SellingPlan\\/460652611",
"name":"Monthly",
"options":[
"1 MONTH"
],
"position":2
}
}
]
},
"products":{
"edges":[
{
"node":{
"title":"Pawty Picks - Monthly Subscription Box"
}
},
{
"node":{
"title":"Pawty Stronger Picks - Monthly Subscription Box"
}
},
{
"node":{
"title":"Pawty Smaller Picks - Monthly Subscription Box"
}
}
]
}
}
},
}
And here is the query I have passed to update the plan. I’ve Just Interchange their names like Monthly to Bi Monthly and vice versa.
mutation {
sellingPlanGroupUpdate(
id: "gid://shopify/SellingPlanGroup/68747331"
input: {
name: "Pawty Pick Monthly Subscription"
merchantCode: "Pawty Pick Monthly Subscription"
sellingPlansToUpdate: [
{
id: "gid://shopify/SellingPlan/460619843",
name: "Monthly",
options: "2 MONTH",
billingPolicy: { recurring: { interval: MONTH, intervalCount: 2 } },
deliveryPolicy: { recurring: { interval: MONTH, intervalCount: 2 } },
pricingPolicies: [
{
fixed: {
adjustmentType: PRICE
adjustmentValue: { fixedValue :54.95 }
}
}]
},
{
id: "gid://shopify/SellingPlan/460652611",
name: "Bi Monthly",
options: "1 MONTH",
billingPolicy: { recurring: { interval: MONTH, intervalCount: 1 } },
deliveryPolicy: { recurring: { interval: MONTH, intervalCount: 1 } },
pricingPolicies: [
{
fixed: {
adjustmentType: PRICE
adjustmentValue: { fixedValue :49.95 }
}
}]
}]
}
) {
sellingPlanGroup {
id
name
sellingPlans(first:10) {
edges {
node {
id
}
}
}
}
userErrors {
field
message
}
}
}
So it always returns an error.
[ { field: [ 'input', 'sellingPlansToUpdate', '0', 'name' ],
message:
'Name Cannot have multiple selling plans with the same name.' },
{ field: [ 'input', 'sellingPlansToUpdate', '1', 'name' ],
message:
'Name Cannot have multiple selling plans with the same name.' } ]
I am updating both of the selling plans by just changing their name or options and then passes.
How do I change just name or options within multiple selling plans then.???