Hello, I am trying to add a range weight conditions on a delivery profile, that’s the code:
query = """
mutation deliveryProfileUpdate($id: ID!, $profile: DeliveryProfileInput!)
{
deliveryProfileUpdate(id: $id, profile: $profile)
{
profile {
id
}
userErrors {
field
message
}
}
}
"""
variables = {
"id":"gid://shopify/DeliveryProfile/{}".format(did),
"profile":{
"locationGroupsToCreate": {
"locations": "gid://shopify/Location/{}".format(location_id),
"zonesToCreate":
{
"name": name,
"countries": countries,
"methodDefinitionsToCreate": [ {
"name": "Spedizione standard",
"active": True,
# Set the rate definition for the delivery zone.
#"rateDefinition": {
# "price": {
# "amount": 0, "currencyCode": "EUR"
# },
#},
"rateDefinition": {
"price": {
"amount": 10.0,
"currencyCode": "EUR"
}
},
"weightConditionsToCreate": {
"criteria": {
"unit": "KILOGRAMS",
"value": weight,
},
"operator": "GREATER_THAN_OR_EQUAL_TO"
}
} for weight in weights
] + [
{
"name": "Spedizione standard",
"active": True,
# Set the rate definition for the delivery zone.
#"rateDefinition": {
# "price": {
# "amount": 0, "currencyCode": "EUR"
# },
#},
"rateDefinition": {
"price": {
"amount": 10.0,
"currencyCode": "EUR"
}
},
"weightConditionsToCreate": {
"criteria": {
"unit": "KILOGRAMS",
"value": weight,
},
"operator": "LESS_THAN_OR_EQUAL_TO"
}
} for weight in weights
]
}
}
}
}
result = shopify.GraphQL().execute(query, variables=variables)
How to properly set the range, like the code above it doesn’t work I have to fille the minumum weight and maximum weight, how to achieve that?