Hey everyone,
I’m running into a frustrating issue with fulfillment constraints functions and hoping someone has found a workaround or can confirm this is a platform limitation.
The Problem:
When building a fulfillment constraints function that’s configured for multiple delivery methods (like both shipping and local pickup), there’s no reliable way to determine which specific delivery method is currently being processed during function execution.
What I’ve tried:
- Checking
cart.deliveryGroups[].deliveryOptions[]- but this is always empty when the function runs - Looking at
cart.deliveryGroups[].selectedDeliveryOption- also null
Expected behavior:
The function input should include some indication of which delivery method context triggered the execution, especially when the function is enabled for multiple delivery types.
Current workaround:
Right now I’m having to create separate function instances for each delivery method, which feels like overkill, and there is also no docs about how constraints work in parallel.
Use case:
I need different constraint logic for local pickup vs shipping. For example, certain products should have different location restrictions depending on whether the customer is picking up or having items shipped.
Has anyone else run into this? Is there a field I’m missing in the GraphQL schema, or is this just how Shopify works rn? Would love to avoid the multiple function approach if possible.