Skip to content

Add sorting to orders tag - #376

Merged
ryanmitchell merged 1 commit into
statamic-rad-pack:mainfrom
GarethFrost:feature/add-sorting-to-orders-tag
Oct 8, 2026
Merged

ryanmitchell merged 1 commit into
statamic-rad-pack:mainfrom
GarethFrost:feature/add-sorting-to-orders-tag

Conversation

@GarethFrost

Copy link
Copy Markdown
Contributor

This PR adds sorting to the shopify orders tag:

src/Tags/Shopify:

  • A new resolveOrderSort() method turns the parameter into Shopify's own sortKey and reverse arguments, which are passed into the orders GraphQL query. Shopify does the sorting, so the order holds across every page of results it returns.
  • Allowed fields: created_at, customer_name, destination, financial_status, fulfillment_status, id, order_number, po_number, processed_at, total_items_quantity, total_price, updated_at.
  • The direction defaults to asc if you leave it off.
  • An unknown field is ignored rather than causing an error, and the orders come back in Shopify's default order.

Updated tests and docs

This PR adds sorting to the shopify orders tag:

src/Tags/Shopify:
- A new resolveOrderSort() method turns the parameter into Shopify's own sortKey and reverse arguments, which are passed into the orders GraphQL query. Shopify does the sorting, so the order holds across every page of results it returns.
- Allowed fields: created_at, customer_name, destination, financial_status, fulfillment_status, id, order_number, po_number, processed_at, total_items_quantity, total_price, updated_at.
- The direction defaults to asc if you leave it off.
- An unknown field is ignored rather than causing an error, and the orders come back in Shopify's default order.

Updated tests and docs
@ryanmitchell
ryanmitchell merged commit cd1c337 into statamic-rad-pack:main Oct 8, 2026
6 checks passed
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