Skip to content

Sync latest discount function examples - #84

Merged
iphipps merged 1 commit into
Shopify:mainfrom
robertcooper-shopify:sync-delivery-discount-shipping-groups
Nov 9, 2026
Merged

iphipps merged 1 commit into
Shopify:mainfrom
robertcooper-shopify:sync-delivery-discount-shipping-groups

Conversation

@robertcooper-shopify

Copy link
Copy Markdown
Contributor

Regenerates the reference app from Discount Functions Testing at f82aa437. The output is committed as generated, with no manual edits.

Delivery discounts

The delivery discount functions in the JavaScript and Rust default and metafield examples used to discount only deliveryGroups[0]. A cart that splits into a pickup group and a shipping group can list the pickup group first, which put the discount on pickup while shipping kept its full price.

They now check every delivery group and discount only the groups with a SHIPPING option. An inline comment marks where to add other delivery methods such as LOCAL. The input queries add deliveryOptions { deliveryMethodType }, and a cart with no shipping group gets no operations instead of an error. The CLI discount template got the same change in Shopify/function-examples#664.

Other generated changes

These came from earlier Discount Functions Testing changes, not this one:

  • api_version moves from 2026-01 to 2026-10 in each example's shopify.extension.toml, with updated schema.graphql files and generated types.
  • The Rust cart_lines functions in default and metafield set the new prerequisites field to None.
  • The Node engine goes from >=22.22.0 to >=22.23.4, with lockfile updates.

Validation

  • A second generation from the same source left the worktree clean.
  • The JavaScript default example passes its 11 tests, the Rust default example passes its 7, and the Rust metafield example builds.

@robertcooper-shopify
robertcooper-shopify marked this pull request as ready for review November 6, 2026 19:46
@iphipps
iphipps merged commit c3a1f6d into Shopify:main Nov 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants