Re: Why is deliveryGroups returning an empty array in Shopify?

How to get selected delivery options in Shopify app using function extension?

Meltin-Bit
Shopify Partner
27 0 10

In a Shopify app with a function extension I am trying to get in the input.graphql the delivery options selected at checkout. In the docs i didn't find anything.

I came up with the following. Everything works but deliveryGroups returns always a empty array. Did someone is facing the same?

 

Thanks in advance.

F.

query Input {
	cart {
		lines {
			quantity
			merchandise {
				__typename
				... on ProductVariant {
					id
					sku
				}
			}
		}
		deliveryGroups {
			selectedDeliveryOption {
				deliveryMethodType
			}
		}
	}
	discountNode {
		metafield(namespace: "function-discounts", key: "function-config") {
			value
		}
	}
}

 

Meltin Bit
Replies 6 (6)

vixnguyen
Shopify Partner
45 4 5

I'm facing the same issue. It takes time to investigate if I'm doing wrong, but finally I realized that it's the issue of platform.

LucasBudi
Shopify Partner
7 0 5

We are facing the same thing but only for Order Discounts functions, while for Shipping Discount functions we get the deliveryGroups fine. Seems to be an issue with the Order Discount API, although the `input.cart` type is identical between the 2 https://shopify.dev/docs/api/functions/reference/order-discounts/graphql/common-objects/cart

onur_alp4
Shopify Partner
2 0 0

I'm having the same issue with cart query. I can confirm that I'm mutating "cartBuyerIdentityUpdate" successfully but deliveryGroup is always empty no matter what I try. My store only have local Delivery and pickup options and I'm coding a Hydrogen store. 

What's the catch with this deliveryGroup? Is it available only under some conditions or what should we check further?
Ps. I'm having the same issue with shopify-graphiql-app

Côme
Shopify Partner
5 0 0

Hey !
I know it's been a while, but I'm facing the exact same issue and I haven't been able to find a solution yet.
Did you work it out ?

Thanks !

Meltin-Bit
Shopify Partner
27 0 10

No solutions yet, probably a platform issue.

Meltin Bit
onur_alp4
Shopify Partner
2 0 0

Yep, no solutions unfortunately. Had to update scope of the specs with the client and tried to solve the main problem in another way